huangjiajun преди 4 месеца
родител
ревизия
1a5c5a3597
променени са 2 файла, в които са добавени 0 реда и са изтрити 113 реда
  1. +0
    -40
      app/enum/enum_qualification.go
  2. +0
    -73
      app/svc/svc_medium_qualification.go

+ 0
- 40
app/enum/enum_qualification.go Целия файл

@@ -1,40 +0,0 @@
package enum

type QualificationState int32

const (
QualificationStateForWait = 1
QualificationStateForNormal = 2
QualificationStateForFail = 3
)

func (gt QualificationState) String() string {
switch gt {
case QualificationStateForNormal:
return "审核成功"
case QualificationStateForFail:
return "审核失败"
case QualificationStateForWait:
return "待审核"
default:
return "待审核"
}
}

type QualificationType int32

const (
QualificationTypeCompany = 1
QualificationTypeOwn = 2
)

func (gt QualificationType) String() string {
switch gt {
case QualificationTypeCompany:
return "企业"
case QualificationTypeOwn:
return "个人"
default:
return "未知"
}
}

+ 0
- 73
app/svc/svc_medium_qualification.go Целия файл

@@ -1,73 +0,0 @@
package svc

import (
"applet/app/e"
"applet/app/enum"
"applet/app/md"
"applet/app/utils"
db "code.fnuoos.com/zhimeng/model.git/src"
"code.fnuoos.com/zhimeng/model.git/src/super/implement"
"code.fnuoos.com/zhimeng/model.git/src/super/model"
"github.com/gin-gonic/gin"
)

func MediumQualificationEnterprise(c *gin.Context, req md.MediumQualificationEnterpriseReq) map[string]interface{} {

if req.Limit == 0 {
req.Limit = 10
}
if req.Page == 0 {
req.Page = 1
}
engine := db.Db
MediumListDb := implement.NewMediumListDb(engine)
MediumList, total, _ := MediumListDb.FindMediumList(req.Name, req.State, req.Page, req.Limit)
if len(MediumList) == 0 {
MediumList = make([]model.MediumList, 0)
}
res := map[string]interface{}{
"list": MediumList,
"total": total,
"state": []map[string]interface{}{
{
"name": enum.QualificationState(enum.QualificationStateForWait).String(),
"value": enum.QualificationStateForWait,
},
{
"name": enum.QualificationState(enum.QualificationStateForNormal).String(),
"value": enum.QualificationStateForNormal,
},
{
"name": enum.QualificationState(enum.QualificationStateForFail).String(),
"value": enum.QualificationStateForFail,
},
},
"type": []map[string]interface{}{
{
"name": enum.QualificationType(enum.QualificationTypeCompany).String(),
"value": enum.QualificationTypeCompany,
},
{
"name": enum.QualificationType(enum.QualificationTypeOwn).String(),
"value": enum.QualificationTypeOwn,
},
},
}
return res
}

func MediumQualificationEnterpriseAudit(c *gin.Context, req md.MediumQualificationEnterpriseAuditReq) error {
engine := db.Db
MediumListDb := implement.NewMediumListDb(engine)
data, _ := MediumListDb.GetMediumList(req.MediumId)
if data == nil {
return e.NewErr(400, "记录不存在")
}
if data.State == 1 {
return e.NewErr(400, "记录已审核过")
}
data.State = utils.StrToInt(req.State)
data.Memo = req.Memo
engine.Where("agent_id=?", data.MediumId).Cols("state,memo").Update(data)
return nil
}

Зареждане…
Отказ
Запис