feat:完善信息
This commit is contained in:
@ -12,6 +12,7 @@ type Log struct{}
|
||||
|
||||
func (a *Log) Login(c *gin.Context) {
|
||||
form := &struct {
|
||||
api.TenantIDStringForm
|
||||
Name string `json:"name" form:"name"`
|
||||
api.PageForm
|
||||
}{}
|
||||
@ -19,6 +20,6 @@ func (a *Log) Login(c *gin.Context) {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := controller.NewLog()(api.GetSession()(c).(*session.Admin)).Login(form.Name, form.Page, form.PageSize)
|
||||
data, err := controller.NewLog()(api.GetSession()(c).(*session.Admin)).Login(form.Convert(), form.Name, form.Page, form.PageSize)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ type (
|
||||
)
|
||||
|
||||
// Login 登录日志
|
||||
func (c *Log) Login(name string, page, pageSize int) (*controller.ReturnPages, error) {
|
||||
func (c *Log) Login(tenantID uint64, name string, page, pageSize int) (*controller.ReturnPages, error) {
|
||||
mSysUserLoginLogs := model.NewSysUserLoginLog()
|
||||
|
||||
where := make([]*model2.ModelWhere, 0)
|
||||
@ -29,6 +29,9 @@ func (c *Log) Login(name string, page, pageSize int) (*controller.ReturnPages, e
|
||||
if c.TenantID > 0 {
|
||||
where = append(where, model2.NewWhere("l.tenant_id", c.TenantID))
|
||||
}
|
||||
if tenantID > 0 {
|
||||
where = append(where, model2.NewWhere("l.tenant_id", tenantID))
|
||||
}
|
||||
if name != "" {
|
||||
where = append(where, model2.NewWhereLike("u.name", name))
|
||||
}
|
||||
|
@ -3,10 +3,12 @@ package manage
|
||||
import (
|
||||
"SciencesServer/app/basic/config"
|
||||
"SciencesServer/app/service"
|
||||
"SciencesServer/serve/logger"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type ESParams struct {
|
||||
ID uint64
|
||||
Identity int
|
||||
Name string
|
||||
Keywords, Industrys, Researchs []string
|
||||
@ -18,11 +20,18 @@ func (this *ESParams) Set() {
|
||||
for _, v := range this.Industrys {
|
||||
_identitys = append(_identitys, config.GetIndustryInfo(v, "-", "-").Value)
|
||||
}
|
||||
_ = service.NewESManage(
|
||||
//fmt.Println(utils.AnyToJSON(this))
|
||||
//fmt.Println(this.Identity)
|
||||
err := service.NewESManage(
|
||||
service.WithManageID(this.ID),
|
||||
service.WithManageIdentity(this.Identity),
|
||||
service.WithManageTitle(this.Name),
|
||||
service.WithManageIndustry(strings.Join(_identitys, ";")),
|
||||
service.WithManageKeyword(strings.Join(this.Keywords, ";")),
|
||||
service.WithManageResearch(strings.Join(this.Researchs, ";")),
|
||||
).Create()
|
||||
|
||||
if err != nil {
|
||||
logger.ErrorF("ES 身份信息【%d】存储错误【%s】", this.Identity, err)
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ var examineHandle = map[int]func(id, tenantID uint64) (*ExamineManageInfo, error
|
||||
func checkManage(IModel model2.IModel, id uint64) error {
|
||||
IModel.SetID(id)
|
||||
|
||||
if isExist, err := model2.FirstField(IModel, []string{"id", "tenant_id", "examine_status"}); err != nil {
|
||||
if isExist, err := model2.First(IModel); err != nil {
|
||||
return err
|
||||
} else if !isExist {
|
||||
return errors.New("操作错误,数据信息不存在")
|
||||
@ -231,6 +231,7 @@ func (c *Examine) Launch(id uint64, identity, status int, remark string, params
|
||||
}
|
||||
// 存放es中
|
||||
(&ESParams{
|
||||
ID: data.IModel.GetID(),
|
||||
Identity: identity, Name: data.Name, Keywords: data.Keywords,
|
||||
Industrys: data.Industrys, Researchs: data.Researchs,
|
||||
}).Set()
|
||||
|
Reference in New Issue
Block a user