Browse Source

update

master
shenjiachi 1 week ago
parent
commit
c50b79ab74
4 changed files with 15 additions and 7 deletions
  1. +1
    -0
      app/md/im/md_customer_service.go
  2. +6
    -5
      app/md/im/md_emoticon.go
  3. +4
    -1
      app/svc/im/svc_customer_service.go
  4. +4
    -1
      app/svc/im/svc_emoticon.go

+ 1
- 0
app/md/im/md_customer_service.go View File

@@ -5,6 +5,7 @@ type PageCustomerServiceReq struct {
PageSize int `json:"page_size"` PageSize int `json:"page_size"`
State int `json:"state"` //状态 State int `json:"state"` //状态
Memo string `json:"memo" example:"备注"` Memo string `json:"memo" example:"备注"`
Phone string `json:"phone"` // 手机号
} }


type PageCustomerServiceResp struct { type PageCustomerServiceResp struct {


+ 6
- 5
app/md/im/md_emoticon.go View File

@@ -5,6 +5,7 @@ type PageEmoticonReq struct {
PageSize int `json:"page_size"` PageSize int `json:"page_size"`
State int `json:"state"` //状态 State int `json:"state"` //状态
Memo string `json:"memo" example:"备注"` Memo string `json:"memo" example:"备注"`
Name string `json:"name"` // 表情名称
} }


type PageEmoticonResp struct { type PageEmoticonResp struct {
@@ -15,9 +16,9 @@ type PageEmoticonResp struct {
Id int64 `json:"id"` //记录id Id int64 `json:"id"` //记录id
Name string `json:"name" example:"名称"` Name string `json:"name" example:"名称"`
ImgUrl string `json:"img_url" example:"图片地址"` ImgUrl string `json:"img_url" example:"图片地址"`
Sort int `json:"Sort"` // 排序
State int `json:"state"` // 状态0关闭,1开启
Memo string `json:"memo" example:"备注"` // 备注
Sort int `json:"Sort"` // 排序
State int `json:"state"` // 状态0关闭,1开启
Memo string `json:"memo" example:"备注"` // 备注
CreateAt string `json:"create_at" example:"创建时间"` // 创建时间 CreateAt string `json:"create_at" example:"创建时间"` // 创建时间
UpdateAt string `json:"update_at" example:"更新时间"` // 更新时间 UpdateAt string `json:"update_at" example:"更新时间"` // 更新时间
} `json:"list"` } `json:"list"`
@@ -27,7 +28,7 @@ type AddEmoticonReq struct {
Name string `json:"name" example:"名称"` Name string `json:"name" example:"名称"`
ImgUrl string `json:"img_url" example:"图片地址"` ImgUrl string `json:"img_url" example:"图片地址"`
Memo string `json:"memo" example:"备注"` // 备注 Memo string `json:"memo" example:"备注"` // 备注
Sort int `json:"sort"` // 排序
Sort int `json:"sort"` // 排序
} }


type SetEmoticonStateReq struct { type SetEmoticonStateReq struct {
@@ -40,7 +41,7 @@ type UpdateEmoticonReq struct {
Name string `json:"name" example:"名称"` Name string `json:"name" example:"名称"`
ImgUrl string `json:"img_url" example:"图片地址"` ImgUrl string `json:"img_url" example:"图片地址"`
Memo string `json:"memo" example:"备注"` // 备注 Memo string `json:"memo" example:"备注"` // 备注
Sort int `json:"sort"` // 排序
Sort int `json:"sort"` // 排序
} }


type DeleteEmoticonReq struct { type DeleteEmoticonReq struct {


+ 4
- 1
app/svc/im/svc_customer_service.go View File

@@ -14,7 +14,10 @@ func PageCustomerService(req md.PageCustomerServiceReq) (err error, resp md.Page
sess.And("memo LIKE ?", "%"+req.Memo+"%") sess.And("memo LIKE ?", "%"+req.Memo+"%")
} }
if req.State != 0 { if req.State != 0 {
sess.And("memo = ?", req.State)
sess.And("state = ?", req.State)
}
if req.Phone != "" {
sess.And("phone = ?", req.Phone)
} }
var mm []*model.CustomerService var mm []*model.CustomerService
resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Asc("id").FindAndCount(&mm) resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Asc("id").FindAndCount(&mm)


+ 4
- 1
app/svc/im/svc_emoticon.go View File

@@ -14,7 +14,10 @@ func PageEmoticon(req md.PageEmoticonReq) (err error, resp md.PageEmoticonResp)
sess.And("memo LIKE ?", "%"+req.Memo+"%") sess.And("memo LIKE ?", "%"+req.Memo+"%")
} }
if req.State != 0 { if req.State != 0 {
sess.And("memo = ?", req.State)
sess.And("state = ?", req.State)
}
if req.Name != "" {
sess.And("name LIKE ?", "%"+req.Name+"%")
} }
var mm []*model.Emoticon var mm []*model.Emoticon
resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Desc("id").FindAndCount(&mm) resp.Total, err = sess.Limit(req.PageSize, (req.Page-1)*req.PageSize).Desc("id").FindAndCount(&mm)


Loading…
Cancel
Save