1
This commit is contained in:
@@ -12,8 +12,8 @@ import (
|
||||
|
||||
type UserCaCert struct{}
|
||||
|
||||
// GetUserCloudCert 申请云证书-个人
|
||||
func (r *UserCaCert) GetUserCloudCert(c *gin.Context) {
|
||||
// AddUserCloudCert 申请云证书-个人
|
||||
func (r *UserCaCert) AddUserCloudCert(c *gin.Context) {
|
||||
id := c.Param("user_id")
|
||||
if id == "" {
|
||||
responses.FailWithMessage("缺少参数", c)
|
||||
@@ -36,7 +36,7 @@ func (r *UserCaCert) GetUserCloudCert(c *gin.Context) {
|
||||
}()
|
||||
|
||||
userCaCertService := service.UserCaCertService{}
|
||||
_, err = userCaCertService.GetUserCloudCert(tx, userId)
|
||||
_, err = userCaCertService.AddUserCloudCert(tx, userId)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
@@ -47,8 +47,8 @@ func (r *UserCaCert) GetUserCloudCert(c *gin.Context) {
|
||||
responses.Ok(c)
|
||||
}
|
||||
|
||||
// GetHospitalCloudCert 申请云证书-医院
|
||||
func (r *UserCaCert) GetHospitalCloudCert(c *gin.Context) {
|
||||
// AddHospitalCloudCert 申请云证书-医院
|
||||
func (r *UserCaCert) AddHospitalCloudCert(c *gin.Context) {
|
||||
// 业务处理
|
||||
tx := global.Db.Begin()
|
||||
defer func() {
|
||||
@@ -58,7 +58,7 @@ func (r *UserCaCert) GetHospitalCloudCert(c *gin.Context) {
|
||||
}()
|
||||
|
||||
userCaCertService := service.UserCaCertService{}
|
||||
_, err := userCaCertService.GetHospitalCloudCert(tx)
|
||||
_, err := userCaCertService.AddHospitalCloudCert(tx)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
@@ -195,3 +195,15 @@ func (r *UserCaCert) AddUserSignConfig(c *gin.Context) {
|
||||
tx.Commit()
|
||||
responses.Ok(c)
|
||||
}
|
||||
|
||||
// GetHospitalCloudCert 获取医院云证书数据
|
||||
func (r *UserCaCert) GetHospitalCloudCert(c *gin.Context) {
|
||||
userCaCertService := service.UserCaCertService{}
|
||||
userCaCert, err := userCaCertService.GetHospitalCloudCert()
|
||||
if err != nil {
|
||||
responses.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
|
||||
responses.OkWithData(userCaCert, c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user