by Robin at 20231223; contact session
This commit is contained in:
parent
247704ad75
commit
7ea7b36776
api
consts
errcode
proto
contact_customer_service/proto
contact_customer_service_api.gocontact_customer_service_op.gocontact_customer_service_vo_op.gonot_null_def_api.gonot_null_def_op.go
contact_customer_service_session/proto
app/mix
controller
contact_customer_service_api.gocontact_customer_service_op.gocontact_customer_service_session_api.gocontact_customer_service_session_op.goinit.go
dao
service
codecreate
dbstruct
|
@ -13,8 +13,8 @@ const (
|
|||
Ignore = 2 //不感兴趣
|
||||
IsIgnored = 3 //被不感兴趣
|
||||
Friend = 4 //好友
|
||||
UnLockWeixinTo = 5 //主语已向宾语解锁微信
|
||||
AbleToAccessWeixinOf = 6 //主语可从宾语处查看微信
|
||||
UnLockWeixinTo = 5 //主语已向宾语解锁微信-已弃用
|
||||
AbleToAccessWeixinOf = 6 //主语可从宾语处查看微信-已弃用
|
||||
)
|
||||
|
||||
// call_history谓词
|
||||
|
@ -22,3 +22,9 @@ const (
|
|||
Like = 0 //喜欢
|
||||
TakeNoInterest = 1 //无感
|
||||
)
|
||||
|
||||
// contact_customer_service谓词
|
||||
const (
|
||||
ContactCustomerService_FromUser = 0
|
||||
ContactCustomerService_FromSupportor = 1
|
||||
)
|
||||
|
|
|
@ -120,6 +120,9 @@ var ErrCodeMsgMap = map[ErrCode]string{
|
|||
ErrCodeTextAuditTaskSrvFail: "文字审核任务服务错误",
|
||||
ErrCodeTextAuditTaskNotExist: "文字审核任务不存在",
|
||||
ErrCodeTextAuditTaskManuallyPassFail: "文字审核人工通过失败",
|
||||
|
||||
ErrCodeContactCustomerServiceSessionSrvFail: "联系客服对话表服务错误",
|
||||
ErrCodeContactCustomerServiceSessionNotExist: "联系客服对话表不存在",
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -286,6 +289,11 @@ const (
|
|||
ErrCodeTextAuditTaskNotExist ErrCode = -23002 // 文字审核任务不存在
|
||||
ErrCodeTextAuditTaskManuallyPassFail ErrCode = -23003 // 文字审核人工通过失败
|
||||
|
||||
// ContactCustomerServiceSession: 24xxx
|
||||
ErrCodeContactCustomerServiceSessionSrvOk ErrCode = ErrCodeOk
|
||||
ErrCodeContactCustomerServiceSessionSrvFail ErrCode = -24001 // 联系客服对话表服务错误
|
||||
ErrCodeContactCustomerServiceSessionNotExist ErrCode = -24002 // 联系客服对话表不存在
|
||||
|
||||
// Media: 60xxx
|
||||
ErrCodeMediaSrvOk ErrCode = ErrCodeOk
|
||||
ErrCodeMediaSrvFail ErrCode = -60001 // 媒体服务错误
|
||||
|
|
|
@ -19,21 +19,21 @@ type ApiCreateResp struct {
|
|||
Data *ApiCreateData `json:"data"`
|
||||
}
|
||||
|
||||
// api 列表-单mid查询
|
||||
type ApiListByMidReq struct {
|
||||
// api 列表-单session_id查询
|
||||
type ApiListBySessionIdReq struct {
|
||||
base.BaseRequest
|
||||
Mid *int64 `json:"mid"`
|
||||
Offset int `json:"offset"`
|
||||
Limit int `json:"limit"`
|
||||
SessionId *int64 `json:"session_id"`
|
||||
Offset int `json:"offset"`
|
||||
Limit int `json:"limit"`
|
||||
}
|
||||
|
||||
type ApiListByMidData struct {
|
||||
type ApiListBySessionIdData struct {
|
||||
List []*dbstruct.ContactCustomerService `json:"list"`
|
||||
Offset int `json:"offset"`
|
||||
More int `json:"more"`
|
||||
}
|
||||
|
||||
type ApiListByMidResp struct {
|
||||
type ApiListBySessionIdResp struct {
|
||||
base.BaseResponse
|
||||
Data *ApiListByMidData `json:"data"`
|
||||
Data *ApiListBySessionIdData `json:"data"`
|
||||
}
|
||||
|
|
|
@ -19,20 +19,6 @@ type OpCreateResp struct {
|
|||
Data *OpCreateData `json:"data"`
|
||||
}
|
||||
|
||||
// op 删除
|
||||
type OpDeleteReq struct {
|
||||
base.BaseRequest
|
||||
Id *int64 `json:"id"`
|
||||
}
|
||||
|
||||
type OpDeleteData struct {
|
||||
}
|
||||
|
||||
type OpDeleteResp struct {
|
||||
base.BaseResponse
|
||||
Data *OpDeleteData `json:"data"`
|
||||
}
|
||||
|
||||
// op 更新
|
||||
type OpUpdateByIdsReq struct {
|
||||
base.BaseRequest
|
||||
|
@ -48,35 +34,35 @@ type OpUpdateByIdsResp struct {
|
|||
Data *OpUpdateByIdsData `json:"data"`
|
||||
}
|
||||
|
||||
// op 列表
|
||||
type OpListReq struct {
|
||||
// op 查询所有未读
|
||||
type OpListUnreadReq struct {
|
||||
base.BaseRequest
|
||||
}
|
||||
|
||||
type OpListData struct {
|
||||
List []*ContactCustomerServiceOpVO `json:"list"`
|
||||
type OpListUnreadData struct {
|
||||
List []*ContactCustomerServiceOpUnreadVO `json:"list"`
|
||||
}
|
||||
|
||||
type OpListResp struct {
|
||||
type OpListUnreaResp struct {
|
||||
base.BaseResponse
|
||||
Data *OpListData `json:"data"`
|
||||
Data *OpListUnreadData `json:"data"`
|
||||
}
|
||||
|
||||
// api 列表-单mid查询
|
||||
type OpListByMidReq struct {
|
||||
// api 列表-单sessionId查询
|
||||
type OpListBySessionIdReq struct {
|
||||
base.BaseRequest
|
||||
Mid *int64 `json:"mid"`
|
||||
Offset int `json:"offset"`
|
||||
Limit int `json:"limit"`
|
||||
SessionId *int64 `json:"session_id"`
|
||||
Offset int `json:"offset"`
|
||||
Limit int `json:"limit"`
|
||||
}
|
||||
|
||||
type OpListByMidData struct {
|
||||
type OpListBySessionIdData struct {
|
||||
List []*dbstruct.ContactCustomerService `json:"list"`
|
||||
Offset int `json:"offset"`
|
||||
More int `json:"more"`
|
||||
}
|
||||
|
||||
type OpListByMidResp struct {
|
||||
type OpListBySessionIdResp struct {
|
||||
base.BaseResponse
|
||||
Data *OpListByMidData `json:"data"`
|
||||
Data *OpListBySessionIdData `json:"data"`
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package proto
|
|||
|
||||
import "service/dbstruct"
|
||||
|
||||
type ContactCustomerServiceOpVO struct {
|
||||
Mid int64 `json:"mid"` // 待回复用户mid
|
||||
List []*dbstruct.ContactCustomerService `json:"contents"` // 待回复用户内容
|
||||
type ContactCustomerServiceOpUnreadVO struct {
|
||||
SessionId int64 `json:"session_id"` // 待回复用户mid
|
||||
List []*dbstruct.ContactCustomerService `json:"contents"` // 待回复用户内容
|
||||
}
|
||||
|
|
|
@ -6,19 +6,18 @@ import (
|
|||
|
||||
// api 创建
|
||||
func (p *ApiCreateReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 4)
|
||||
params = make([]*validator.JsonParam, 0)
|
||||
|
||||
params[0] = validator.NewInt64PtrParam("请填写主语mid!", p.SubMid)
|
||||
params[1] = validator.NewInt64PtrParam("请填写宾语mid!", p.ObjMid)
|
||||
params[2] = validator.NewInt64PtrParam("请填写谓词!", p.Predicate)
|
||||
params[3] = validator.NewStringPtrParam("请填写聊天信息!", p.Message)
|
||||
params = append(params, validator.NewInt64PtrParam("请填写对话ID!", p.SessionId))
|
||||
params = append(params, validator.NewInt64PtrParam("请填写谓词!", p.Predicate))
|
||||
params = append(params, validator.NewStringPtrParam("请填写聊天信息!", p.Message))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// api 列表
|
||||
func (p *ApiListByMidReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 1)
|
||||
params[0] = validator.NewInt64PtrParam("mid should not be null", p.Mid)
|
||||
func (p *ApiListBySessionIdReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 0)
|
||||
params = append(params, validator.NewInt64PtrParam("session_id should not be null", p.SessionId))
|
||||
return params
|
||||
}
|
||||
|
|
|
@ -6,35 +6,25 @@ import (
|
|||
|
||||
// op 创建
|
||||
func (p *OpCreateReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 4)
|
||||
params = make([]*validator.JsonParam, 0)
|
||||
|
||||
params[0] = validator.NewInt64PtrParam("请填写主语mid!", p.SubMid)
|
||||
params[1] = validator.NewInt64PtrParam("请填写宾语mid!", p.ObjMid)
|
||||
params[2] = validator.NewInt64PtrParam("请填写谓词!", p.Predicate)
|
||||
params[3] = validator.NewStringPtrParam("请填写聊天信息!", p.Message)
|
||||
params = append(params, validator.NewInt64PtrParam("请填写对话ID!", p.SessionId))
|
||||
params = append(params, validator.NewInt64PtrParam("请填写谓词!", p.Predicate))
|
||||
params = append(params, validator.NewStringPtrParam("请填写聊天信息!", p.Message))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// op 按id更新
|
||||
func (p *OpUpdateByIdsReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 1)
|
||||
params[0] = validator.NewInt64SliceParam("欲更新的联系客服Ids为空!", p.Ids)
|
||||
params = make([]*validator.JsonParam, 0)
|
||||
params = append(params, validator.NewInt64SliceParam("欲更新的联系客服Ids为空!", p.Ids))
|
||||
return params
|
||||
}
|
||||
|
||||
// op 删除
|
||||
func (p *OpDeleteReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 1)
|
||||
|
||||
params[0] = validator.NewInt64PtrParam("请填写欲删除的聊天记录Id!", p.Id)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// op 列表
|
||||
func (p *OpListByMidReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 1)
|
||||
params[0] = validator.NewInt64PtrParam("mid should not be null", p.Mid)
|
||||
func (p *OpListBySessionIdReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 0)
|
||||
params = append(params, validator.NewInt64PtrParam("session_id should not be null", p.SessionId))
|
||||
return params
|
||||
}
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package proto
|
||||
|
||||
import (
|
||||
"service/api/base"
|
||||
"service/dbstruct"
|
||||
)
|
||||
|
||||
// op 创建
|
||||
type ApiCreateReq struct {
|
||||
base.BaseRequest
|
||||
*dbstruct.ContactCustomerServiceSession
|
||||
}
|
||||
|
||||
type ApiCreateData struct {
|
||||
SessionId int64 `json:"session_id"`
|
||||
}
|
||||
|
||||
type ApiCreateResp struct {
|
||||
base.BaseResponse
|
||||
Data *ApiCreateData `json:"data"`
|
||||
}
|
||||
|
||||
// op 更新
|
||||
type ApiUpdateReq struct {
|
||||
base.BaseRequest
|
||||
*dbstruct.ContactCustomerServiceSession
|
||||
}
|
||||
|
||||
type ApiUpdateData struct {
|
||||
}
|
||||
|
||||
type ApiUpdateResp struct {
|
||||
base.BaseResponse
|
||||
Data *ApiUpdateData `json:"data"`
|
||||
}
|
||||
|
||||
// op 列表
|
||||
type ApiListByMidReq struct {
|
||||
base.BaseRequest
|
||||
Mid *int64 `json:"mid"`
|
||||
}
|
||||
|
||||
type ApiListByMidData struct {
|
||||
Session *dbstruct.ContactCustomerServiceSession `json:"session"`
|
||||
}
|
||||
|
||||
type ApiListResp struct {
|
||||
base.BaseResponse
|
||||
Data *ApiListByMidData `json:"data"`
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package proto
|
||||
|
||||
import (
|
||||
"service/api/base"
|
||||
"service/dbstruct"
|
||||
)
|
||||
|
||||
// op 创建
|
||||
type OpCreateReq struct {
|
||||
base.BaseRequest
|
||||
*dbstruct.ContactCustomerServiceSession
|
||||
}
|
||||
|
||||
type OpCreateData struct {
|
||||
SessionId int64 `json:"session_id"`
|
||||
}
|
||||
|
||||
type OpCreateResp struct {
|
||||
base.BaseResponse
|
||||
Data *OpCreateData `json:"data"`
|
||||
}
|
||||
|
||||
// op 更新
|
||||
type OpUpdateReq struct {
|
||||
base.BaseRequest
|
||||
*dbstruct.ContactCustomerServiceSession
|
||||
}
|
||||
|
||||
type OpUpdateData struct {
|
||||
}
|
||||
|
||||
type OpUpdateResp struct {
|
||||
base.BaseResponse
|
||||
Data *OpUpdateData `json:"data"`
|
||||
}
|
||||
|
||||
// op 列表
|
||||
type OpListByMidReq struct {
|
||||
base.BaseRequest
|
||||
Mid *int64 `json:"mid"`
|
||||
}
|
||||
|
||||
type OpListByMidData struct {
|
||||
Session *dbstruct.ContactCustomerServiceSession `json:"session"`
|
||||
}
|
||||
|
||||
type OpListByMidResp struct {
|
||||
base.BaseResponse
|
||||
Data *OpListByMidData `json:"data"`
|
||||
}
|
||||
|
||||
// op 列出所有对话
|
||||
type OpListReq struct {
|
||||
base.BaseRequest
|
||||
Offset int `json:"offset"`
|
||||
Limit int `json:"limit"`
|
||||
}
|
||||
|
||||
type OpListData struct {
|
||||
List []*dbstruct.ContactCustomerServiceSession `json:"data"`
|
||||
Offset int `json:"offset"`
|
||||
More int `json:"more"`
|
||||
}
|
||||
|
||||
type OpListResp struct {
|
||||
base.BaseResponse
|
||||
Data *OpListData `json:"data"`
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package proto
|
||||
|
||||
import (
|
||||
"service/library/validator"
|
||||
)
|
||||
|
||||
// api 创建
|
||||
func (p *ApiCreateReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 0)
|
||||
|
||||
params = append(params, validator.NewInt64PtrParam("请填写主语mid!", p.SubMid))
|
||||
params = append(params, validator.NewInt64PtrParam("请填写宾语mid!", p.ObjMid))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// api 列表-mid单查
|
||||
func (p *ApiListByMidReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 0)
|
||||
params = append(params, validator.NewInt64PtrParam("mid should not be null", p.Mid))
|
||||
return params
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package proto
|
||||
|
||||
import (
|
||||
"service/library/validator"
|
||||
)
|
||||
|
||||
// op 创建
|
||||
func (p *OpCreateReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 0)
|
||||
|
||||
params = append(params, validator.NewInt64PtrParam("请填写主语mid!", p.SubMid))
|
||||
params = append(params, validator.NewInt64PtrParam("请填写宾语mid!", p.ObjMid))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// op 列表-mid单查
|
||||
func (p *OpListByMidReq) ProvideNotNullValue() (params []*validator.JsonParam) {
|
||||
params = make([]*validator.JsonParam, 0)
|
||||
params = append(params, validator.NewInt64PtrParam("mid should not be null", p.Mid))
|
||||
return params
|
||||
}
|
|
@ -23,22 +23,22 @@ func ApiCreateContactCustomerService(ctx *gin.Context) {
|
|||
ReplyOk(ctx, nil)
|
||||
}
|
||||
|
||||
func ApiGetContactCustomerServiceListByMid(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_serviceproto.ApiListByMidReq)
|
||||
func ApiGetContactCustomerServiceListBySessionId(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_serviceproto.ApiListBySessionIdReq)
|
||||
|
||||
//设置默认页长
|
||||
if req.Limit == 0 {
|
||||
req.Limit = consts.DefaultPageSize
|
||||
}
|
||||
|
||||
list, ec := service.DefaultService.ApiGetContactCustomerServiceListByMid(ctx, req)
|
||||
list, ec := service.DefaultService.ApiGetContactCustomerServiceListBySessionId(ctx, req)
|
||||
if ec != errcode.ErrCodeContactCustomerServiceSrvOk {
|
||||
logger.Error("OpGetContactCustomerServiceListByMid fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
logger.Error("OpGetContactCustomerServiceListBySessionId fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrCodeMsg(ctx, ec)
|
||||
return
|
||||
}
|
||||
|
||||
data := &contact_customer_serviceproto.ApiListByMidData{
|
||||
data := &contact_customer_serviceproto.ApiListBySessionIdData{
|
||||
List: list,
|
||||
Offset: req.Offset + len(list),
|
||||
}
|
||||
|
|
|
@ -35,34 +35,22 @@ func OpUpdateContactCustomerServiceByIds(ctx *gin.Context) {
|
|||
ReplyOk(ctx, nil)
|
||||
}
|
||||
|
||||
func OpDeleteContactCustomerService(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_serviceproto.OpDeleteReq)
|
||||
ec := service.DefaultService.OpDeleteContactCustomerService(ctx, util.DerefInt64(req.Id))
|
||||
if ec != errcode.ErrCodeContactCustomerServiceSrvOk {
|
||||
logger.Error("OpDeleteContactCustomerService fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrCodeMsg(ctx, ec)
|
||||
return
|
||||
}
|
||||
|
||||
ReplyOk(ctx, nil)
|
||||
}
|
||||
|
||||
func OpGetContactCustomerServiceListByMid(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_serviceproto.OpListByMidReq)
|
||||
func OpGetContactCustomerServiceListBySessionId(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_serviceproto.OpListBySessionIdReq)
|
||||
|
||||
//设置默认页长
|
||||
if req.Limit == 0 {
|
||||
req.Limit = consts.DefaultPageSize
|
||||
}
|
||||
|
||||
list, ec := service.DefaultService.OpGetContactCustomerServiceListByMid(ctx, req)
|
||||
list, ec := service.DefaultService.OpGetContactCustomerServiceListBySessionId(ctx, req)
|
||||
if ec != errcode.ErrCodeContactCustomerServiceSrvOk {
|
||||
logger.Error("OpGetContactCustomerServiceListByMid fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
logger.Error("OpGetContactCustomerServiceListBySessionId fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrCodeMsg(ctx, ec)
|
||||
return
|
||||
}
|
||||
|
||||
data := &contact_customer_serviceproto.OpListByMidData{
|
||||
data := &contact_customer_serviceproto.OpListBySessionIdData{
|
||||
List: list,
|
||||
Offset: req.Offset + len(list),
|
||||
}
|
||||
|
@ -73,7 +61,7 @@ func OpGetContactCustomerServiceListByMid(ctx *gin.Context) {
|
|||
}
|
||||
|
||||
func OpGetContactCustomerServiceListUnreadGroupByMid(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_serviceproto.OpListReq)
|
||||
req := ctx.MustGet("client_req").(*contact_customer_serviceproto.OpListUnreadReq)
|
||||
|
||||
list, ec := service.DefaultService.OpGetContactCustomerServiceListUnreadGroupByMid(ctx, req)
|
||||
if ec != errcode.ErrCodeContactCustomerServiceSrvOk {
|
||||
|
@ -82,7 +70,7 @@ func OpGetContactCustomerServiceListUnreadGroupByMid(ctx *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
data := &contact_customer_serviceproto.OpListData{
|
||||
data := &contact_customer_serviceproto.OpListUnreadData{
|
||||
List: list,
|
||||
}
|
||||
ReplyOk(ctx, data)
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package controller
|
||||
|
||||
import (
|
||||
"service/api/errcode"
|
||||
contact_customer_service_sessionproto "service/api/proto/contact_customer_service_session/proto"
|
||||
"service/app/mix/service"
|
||||
"service/bizcommon/util"
|
||||
"service/library/logger"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func ApiCreateContactCustomerServiceSession(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.ApiCreateReq)
|
||||
ec := service.DefaultService.ApiCreateContactCustomerServiceSession(ctx, req)
|
||||
if ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk {
|
||||
logger.Error("ApiCreateContactCustomerServiceSession fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrorMsg(ctx, "server error")
|
||||
return
|
||||
}
|
||||
|
||||
data := &contact_customer_service_sessionproto.ApiCreateData{
|
||||
SessionId: util.DerefInt64(req.Id),
|
||||
}
|
||||
|
||||
ReplyOk(ctx, data)
|
||||
}
|
||||
|
||||
func ApiGetContactCustomerServiceSessionListByMid(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.ApiListByMidReq)
|
||||
session, ec := service.DefaultService.ApiGetContactCustomerServiceSessionListByMid(ctx, req)
|
||||
if ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk {
|
||||
logger.Error("ApiGetContactCustomerServiceSessionListByMid fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrCodeMsg(ctx, ec)
|
||||
return
|
||||
}
|
||||
|
||||
data := &contact_customer_service_sessionproto.ApiListByMidData{
|
||||
Session: session,
|
||||
}
|
||||
ReplyOk(ctx, data)
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package controller
|
||||
|
||||
import (
|
||||
"service/api/errcode"
|
||||
contact_customer_service_sessionproto "service/api/proto/contact_customer_service_session/proto"
|
||||
"service/app/mix/service"
|
||||
"service/bizcommon/util"
|
||||
"service/library/logger"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func OpCreateContactCustomerServiceSession(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.OpCreateReq)
|
||||
ec := service.DefaultService.OpCreateContactCustomerServiceSession(ctx, req)
|
||||
if ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk {
|
||||
logger.Error("OpCreateContactCustomerServiceSession fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrorMsg(ctx, "server error")
|
||||
return
|
||||
}
|
||||
|
||||
data := &contact_customer_service_sessionproto.OpCreateData{
|
||||
SessionId: util.DerefInt64(req.Id),
|
||||
}
|
||||
|
||||
ReplyOk(ctx, data)
|
||||
}
|
||||
|
||||
func OpGetContactCustomerServiceSessionListByMid(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.OpListByMidReq)
|
||||
session, ec := service.DefaultService.OpGetContactCustomerServiceSessionListByMid(ctx, req)
|
||||
if ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk {
|
||||
logger.Error("OpGetContactCustomerServiceSessionListByMid fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrCodeMsg(ctx, ec)
|
||||
return
|
||||
}
|
||||
|
||||
data := &contact_customer_service_sessionproto.OpListByMidData{
|
||||
Session: session,
|
||||
}
|
||||
ReplyOk(ctx, data)
|
||||
}
|
||||
|
||||
func OpGetContactCustomerServiceSessionList(ctx *gin.Context) {
|
||||
req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.OpListReq)
|
||||
list, ec := service.DefaultService.OpGetContactCustomerServiceSessionList(ctx, req)
|
||||
if ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk {
|
||||
logger.Error("OpGetContactCustomerServiceSessionList fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrCodeMsg(ctx, ec)
|
||||
return
|
||||
}
|
||||
|
||||
data := &contact_customer_service_sessionproto.OpListData{
|
||||
List: list,
|
||||
}
|
||||
ReplyOk(ctx, data)
|
||||
}
|
|
@ -22,6 +22,7 @@ import (
|
|||
accountrelationproto "service/api/proto/accountrelation/proto"
|
||||
callhistoryproto "service/api/proto/callhistory/proto"
|
||||
contact_customer_serviceproto "service/api/proto/contact_customer_service/proto"
|
||||
contact_customer_service_sessionproto "service/api/proto/contact_customer_service_session/proto"
|
||||
feedbackproto "service/api/proto/feedback/proto"
|
||||
footprintproto "service/api/proto/footprint/proto"
|
||||
loginproto "service/api/proto/login/proto"
|
||||
|
@ -136,7 +137,12 @@ func Init(r *gin.Engine) {
|
|||
// 联系客服
|
||||
apiContactCustomerServiceGroup := r.Group("/api/contact_customer_service", PrepareToC())
|
||||
apiContactCustomerServiceGroup.POST("create", middleware.JSONParamValidator(contact_customer_serviceproto.ApiCreateReq{}), ApiCreateContactCustomerService)
|
||||
apiContactCustomerServiceGroup.POST("list_by_mid", middleware.JSONParamValidator(contact_customer_serviceproto.ApiListByMidReq{}), ApiGetContactCustomerServiceListByMid)
|
||||
apiContactCustomerServiceGroup.POST("list_by_mid", middleware.JSONParamValidator(contact_customer_serviceproto.ApiListBySessionIdReq{}), ApiGetContactCustomerServiceListBySessionId)
|
||||
|
||||
// 联系客服对话表
|
||||
apiContactCustomerServiceSessionGroup := r.Group("/api/contact_customer_service_session", PrepareToC())
|
||||
apiContactCustomerServiceSessionGroup.POST("create", middleware.JSONParamValidator(contact_customer_service_sessionproto.ApiCreateReq{}), ApiCreateContactCustomerServiceSession)
|
||||
apiContactCustomerServiceSessionGroup.POST("list_by_mid", middleware.JSONParamValidator(contact_customer_service_sessionproto.ApiListByMidReq{}), ApiGetContactCustomerServiceSessionListByMid)
|
||||
|
||||
// 主播标签
|
||||
apiStreamerTagGroup := r.Group("/api/streamer_tag", PrepareOp())
|
||||
|
@ -302,8 +308,14 @@ func Init(r *gin.Engine) {
|
|||
opContactCustomerServiceGroup.POST("create", middleware.JSONParamValidator(contact_customer_serviceproto.OpCreateReq{}), OpCreateContactCustomerService)
|
||||
opContactCustomerServiceGroup.POST("update_by_ids", middleware.JSONParamValidator(contact_customer_serviceproto.OpUpdateByIdsReq{}), OpUpdateContactCustomerServiceByIds)
|
||||
//opContactCustomerServiceGroup.POST("delete", middleware.JSONParamValidator(contact_customer_serviceproto.OpDeleteReq{}), OpDeleteContactCustomerService)
|
||||
opContactCustomerServiceGroup.POST("list_by_mid", middleware.JSONParamValidator(contact_customer_serviceproto.OpListByMidReq{}), OpGetContactCustomerServiceListByMid)
|
||||
opContactCustomerServiceGroup.POST("list_unread_group_by_mid", middleware.JSONParamValidator(contact_customer_serviceproto.OpListReq{}), OpGetContactCustomerServiceListUnreadGroupByMid)
|
||||
opContactCustomerServiceGroup.POST("list_by_session", middleware.JSONParamValidator(contact_customer_serviceproto.OpListBySessionIdReq{}), OpGetContactCustomerServiceListBySessionId)
|
||||
opContactCustomerServiceGroup.POST("list_unread_group_by_session_id", middleware.JSONParamValidator(contact_customer_serviceproto.OpListUnreadReq{}), OpGetContactCustomerServiceListUnreadGroupByMid)
|
||||
|
||||
// 联系客服对话表
|
||||
opContactCustomerServiceSessionGroup := r.Group("/op/contact_customer_service_session", PrepareOp())
|
||||
opContactCustomerServiceSessionGroup.POST("create", middleware.JSONParamValidator(contact_customer_service_sessionproto.OpCreateReq{}), OpCreateContactCustomerServiceSession)
|
||||
opContactCustomerServiceSessionGroup.POST("list_by_mid", middleware.JSONParamValidator(contact_customer_service_sessionproto.OpListByMidReq{}), OpGetContactCustomerServiceSessionListByMid)
|
||||
opContactCustomerServiceSessionGroup.POST("list", middleware.JSONParamValidator(contact_customer_service_sessionproto.OpListReq{}), OpGetContactCustomerServiceSessionList)
|
||||
|
||||
// 图片审核任务
|
||||
opImageAuditTaskGroup := r.Group("/op/image_audit_task", PrepareOp())
|
||||
|
|
|
@ -17,6 +17,7 @@ import (
|
|||
accountrelationproto "service/api/proto/accountrelation/proto"
|
||||
callhistoryproto "service/api/proto/callhistory/proto"
|
||||
contact_customer_service_proto "service/api/proto/contact_customer_service/proto"
|
||||
contact_customer_service_sessionproto "service/api/proto/contact_customer_service_session/proto"
|
||||
feedbackproto "service/api/proto/feedback/proto"
|
||||
footprintproto "service/api/proto/footprint/proto"
|
||||
imageaudittaskproto "service/api/proto/imageaudittask/proto"
|
||||
|
@ -134,6 +135,9 @@ const (
|
|||
DBTextAudit = "text_audit"
|
||||
COLTextAudit = "text_audit"
|
||||
COLTextAuditTask = "text_audit_task"
|
||||
|
||||
DBContactCustomerServiceSession = "contact_customer_service_session"
|
||||
COLContactCustomerServiceSession = "contact_customer_service_session"
|
||||
)
|
||||
|
||||
// 商品表
|
||||
|
@ -305,6 +309,11 @@ func (m *Mongo) getColTextAuditTask() *qmgo.Collection {
|
|||
return m.clientMix.Database(DBTextAudit).Collection(COLTextAuditTask)
|
||||
}
|
||||
|
||||
// 联系客服对话表表
|
||||
func (m *Mongo) getColContactCustomerServiceSession() *qmgo.Collection {
|
||||
return m.clientMix.Database(DBContactCustomerServiceSession).Collection(COLContactCustomerServiceSession)
|
||||
}
|
||||
|
||||
// 商品相关
|
||||
func (m *Mongo) CreateProduct(ctx *gin.Context, product *dbstruct.Product) error {
|
||||
col := m.getColProduct()
|
||||
|
@ -2103,12 +2112,13 @@ func (m *Mongo) DeleteContactCustomerService(ctx *gin.Context, id int64) error {
|
|||
return err
|
||||
}
|
||||
|
||||
func (m *Mongo) GetContactCustomerServiceListUnread(ctx *gin.Context, req *contact_customer_service_proto.OpListReq) ([]*dbstruct.ContactCustomerService, error) {
|
||||
func (m *Mongo) GetUnreadContactCustomerServiceList(ctx *gin.Context, req *contact_customer_service_proto.OpListUnreadReq) ([]*dbstruct.ContactCustomerService, error) {
|
||||
list := make([]*dbstruct.ContactCustomerService, 0)
|
||||
col := m.getColContactCustomerService()
|
||||
query := qmgo.M{
|
||||
"is_read": consts.ContactCustomerService_NotRead,
|
||||
"del_flag": 0,
|
||||
"is_read": consts.ContactCustomerService_NotRead,
|
||||
"predicate": consts.ContactCustomerService_FromUser,
|
||||
"del_flag": 0,
|
||||
}
|
||||
err := col.Find(ctx, query).Sort("-ct").All(&list)
|
||||
if err == qmgo.ErrNoSuchDocuments {
|
||||
|
@ -2118,12 +2128,12 @@ func (m *Mongo) GetContactCustomerServiceListUnread(ctx *gin.Context, req *conta
|
|||
return list, err
|
||||
}
|
||||
|
||||
func (m *Mongo) GetContactCustomerServiceListByMid(ctx *gin.Context, req *contact_customer_service_proto.OpListByMidReq) ([]*dbstruct.ContactCustomerService, error) {
|
||||
func (m *Mongo) GetContactCustomerServiceListBySessionId(ctx *gin.Context, req *contact_customer_service_proto.OpListBySessionIdReq) ([]*dbstruct.ContactCustomerService, error) {
|
||||
list := make([]*dbstruct.ContactCustomerService, 0)
|
||||
col := m.getColContactCustomerService()
|
||||
query := qmgo.M{
|
||||
"sub_mid": util.DerefInt64(req.Mid),
|
||||
"del_flag": 0,
|
||||
"session_id": util.DerefInt64(req.SessionId),
|
||||
"del_flag": 0,
|
||||
}
|
||||
err := col.Find(ctx, query).Sort("-ct").Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
|
||||
if err == qmgo.ErrNoSuchDocuments {
|
||||
|
@ -2508,3 +2518,50 @@ func (m *Mongo) UpdateTextAuditTaskByIds(ctx *gin.Context, textaudittask *dbstru
|
|||
_, err := col.UpdateAll(ctx, filter, up)
|
||||
return err
|
||||
}
|
||||
|
||||
// 联系客服对话表相关
|
||||
func (m *Mongo) CreateContactCustomerServiceSession(ctx *gin.Context, contact_customer_service_session *dbstruct.ContactCustomerServiceSession) error {
|
||||
col := m.getColContactCustomerServiceSession()
|
||||
_, err := col.InsertOne(ctx, contact_customer_service_session)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *Mongo) UpdateContactCustomerServiceSession(ctx *gin.Context, contact_customer_service_session *dbstruct.ContactCustomerServiceSession) error {
|
||||
col := m.getColContactCustomerServiceSession()
|
||||
set := util.EntityToM(contact_customer_service_session)
|
||||
set["ut"] = time.Now().Unix()
|
||||
up := qmgo.M{
|
||||
"$set": set,
|
||||
}
|
||||
err := col.UpdateId(ctx, contact_customer_service_session.Id, up)
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *Mongo) GetContactCustomerServiceSessionListByMid(ctx *gin.Context, req *contact_customer_service_sessionproto.OpListByMidReq) (*dbstruct.ContactCustomerServiceSession, error) {
|
||||
session := &dbstruct.ContactCustomerServiceSession{}
|
||||
col := m.getColContactCustomerServiceSession()
|
||||
query := qmgo.M{
|
||||
"sub_mid": util.DerefInt64(req.Mid),
|
||||
"del_flag": 0,
|
||||
}
|
||||
err := col.Find(ctx, query).One(&session)
|
||||
if err == qmgo.ErrNoSuchDocuments {
|
||||
err = nil
|
||||
return nil, err
|
||||
}
|
||||
return session, err
|
||||
}
|
||||
|
||||
func (m *Mongo) GetContactCustomerServiceSessionList(ctx *gin.Context, req *contact_customer_service_sessionproto.OpListReq) ([]*dbstruct.ContactCustomerServiceSession, error) {
|
||||
list := make([]*dbstruct.ContactCustomerServiceSession, 0)
|
||||
col := m.getColContactCustomerServiceSession()
|
||||
query := qmgo.M{
|
||||
"del_flag": 0,
|
||||
}
|
||||
err := col.Find(ctx, query).Sort("-ct").Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
|
||||
if err == qmgo.ErrNoSuchDocuments {
|
||||
err = nil
|
||||
return nil, err
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
|
|
@ -39,6 +39,9 @@ const (
|
|||
|
||||
DBContactCustomerServiceIdSeq = "contact_customer_service_id_seq"
|
||||
COLContactCustomerServiceIdSeq = "contact_customer_service_id_seq"
|
||||
|
||||
DBContactCustomerServiceSessionIdSeq = "contact_customer_service_session_id_seq"
|
||||
COLContactCustomerServiceSessionIdSeq = "contact_customer_service_session_id_seq"
|
||||
)
|
||||
|
||||
// UserIdSeq序列表
|
||||
|
@ -91,6 +94,11 @@ func (m *Mongo) getColContactCustomerServiceIdSeq() *qmgo.Collection {
|
|||
return m.clientMix.Database(DBContactCustomerServiceIdSeq).Collection(COLContactCustomerServiceIdSeq)
|
||||
}
|
||||
|
||||
// ContactCustomerServiceSessionIdSeq序列表
|
||||
func (m *Mongo) getColContactCustomerServiceSessionIdSeq() *qmgo.Collection {
|
||||
return m.clientMix.Database(DBContactCustomerServiceSessionIdSeq).Collection(COLContactCustomerServiceIdSeq)
|
||||
}
|
||||
|
||||
// account_id发号器
|
||||
func (m *Mongo) GetAndUpdateAccountIdSeq(ctx *gin.Context) (accountIdSeq *dbstruct.AccountIdSeq, err error) {
|
||||
col := m.getColAccountIdSeq()
|
||||
|
@ -255,7 +263,7 @@ func (m *Mongo) GetAndUpdateRealNameAuthenticationIdSeq(ctx *gin.Context) (realn
|
|||
}
|
||||
|
||||
// contact_customer_service_id发号器
|
||||
func (m *Mongo) GetAndUpdateContactCustomerServiceIdSeq(ctx *gin.Context) (contact_customer_serviceIdSeq *dbstruct.ContactCustomerServiceIdSeq, err error) {
|
||||
func (m *Mongo) GetAndUpdateContactCustomerServiceIdSeq(ctx *gin.Context) (contactCustomerServiceIdSeq *dbstruct.ContactCustomerServiceIdSeq, err error) {
|
||||
col := m.getColContactCustomerServiceIdSeq()
|
||||
|
||||
change := qmgo.Change{
|
||||
|
@ -273,6 +281,25 @@ func (m *Mongo) GetAndUpdateContactCustomerServiceIdSeq(ctx *gin.Context) (conta
|
|||
return &contactCustomerServiceIdSeqInstance, err
|
||||
}
|
||||
|
||||
// contact_customer_service_session_id发号器
|
||||
func (m *Mongo) GetAndUpdateContactCustomerServiceSessionIdSeq(ctx *gin.Context) (sessionIdSeq *dbstruct.ContactCustomerServiceSessionIdSeq, err error) {
|
||||
col := m.getColContactCustomerServiceSessionIdSeq()
|
||||
|
||||
change := qmgo.Change{
|
||||
Update: qmgo.M{"$inc": qmgo.M{"seq": 1}},
|
||||
Upsert: true,
|
||||
ReturnNew: false,
|
||||
}
|
||||
|
||||
contactCustomerServiceSessionIdSeqInstance := dbstruct.ContactCustomerServiceSessionIdSeq{}
|
||||
if err = col.Find(ctx, qmgo.M{"_id": "contact_customer_service_session_id_seq_id"}).Apply(change, &contactCustomerServiceSessionIdSeqInstance); err != nil {
|
||||
logger.Error("change error : %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
return &contactCustomerServiceSessionIdSeqInstance, err
|
||||
}
|
||||
|
||||
// media_id发号器
|
||||
func (m *Mongo) GetAndUpdateMediaSeq(ctx *gin.Context) (mediaIdSeq *dbstruct.MediaIdSeq, err error) {
|
||||
col := m.getColMomentIdSeq()
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
accountproto "service/api/proto/account/proto"
|
||||
accountrelationproto "service/api/proto/accountrelation/proto"
|
||||
contact_customer_service_proto "service/api/proto/contact_customer_service/proto"
|
||||
contact_customer_service_sessionproto "service/api/proto/contact_customer_service_session/proto"
|
||||
feedbackproto "service/api/proto/feedback/proto"
|
||||
loginproto "service/api/proto/login/proto"
|
||||
realname_authenticationproto "service/api/proto/realname_authentication/proto"
|
||||
|
@ -1462,20 +1463,59 @@ func (s *Service) ApiCreateContactCustomerService(ctx *gin.Context, req *contact
|
|||
ec = errcode.ErrCodeContactCustomerServiceSrvFail
|
||||
return
|
||||
}
|
||||
|
||||
//更新session表的内容
|
||||
if err := _DefaultContactCustomerServiceSession.OpUpdate(ctx, &contact_customer_service_sessionproto.OpUpdateReq{
|
||||
ContactCustomerServiceSession: &dbstruct.ContactCustomerServiceSession{
|
||||
Id: req.SessionId,
|
||||
RecentMessage: req.Message,
|
||||
},
|
||||
}); err != nil {
|
||||
logger.Error("Update session fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvFail
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Service) ApiGetContactCustomerServiceListByMid(ctx *gin.Context, req *contact_customer_service_proto.ApiListByMidReq) (list []*dbstruct.ContactCustomerService, ec errcode.ErrCode) {
|
||||
func (s *Service) ApiGetContactCustomerServiceListBySessionId(ctx *gin.Context, req *contact_customer_service_proto.ApiListBySessionIdReq) (list []*dbstruct.ContactCustomerService, ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvOk
|
||||
list, err := _DefaultContactCustomerService.OpListByMid(ctx, &contact_customer_service_proto.OpListByMidReq{
|
||||
Mid: req.Mid,
|
||||
Offset: req.Offset,
|
||||
Limit: req.Limit,
|
||||
list, err := _DefaultContactCustomerService.OpListBySessionId(ctx, &contact_customer_service_proto.OpListBySessionIdReq{
|
||||
SessionId: req.SessionId,
|
||||
Offset: req.Offset,
|
||||
Limit: req.Limit,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Error("OpGetContactCustomerServiceListByMid fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
logger.Error("OpGetContactCustomerServiceListBySessionId fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvFail
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ContactCustomerServiceSession
|
||||
func (s *Service) ApiCreateContactCustomerServiceSession(ctx *gin.Context, req *contact_customer_service_sessionproto.ApiCreateReq) (ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvOk
|
||||
err := _DefaultContactCustomerServiceSession.OpCreate(ctx, &contact_customer_service_sessionproto.OpCreateReq{
|
||||
ContactCustomerServiceSession: req.ContactCustomerServiceSession,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Error("ApiCreate fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvFail
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Service) ApiGetContactCustomerServiceSessionListByMid(ctx *gin.Context, req *contact_customer_service_sessionproto.ApiListByMidReq) (session *dbstruct.ContactCustomerServiceSession, ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvOk
|
||||
session, err := _DefaultContactCustomerServiceSession.OpListByMid(ctx, &contact_customer_service_sessionproto.OpListByMidReq{
|
||||
Mid: req.Mid,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Error("OpListByMid fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvFail
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -63,19 +63,19 @@ func (p *ContactCustomerService) OpDelete(ctx *gin.Context, id int64) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (p *ContactCustomerService) OpListUnread(ctx *gin.Context, req *contact_customer_serviceproto.OpListReq) ([]*dbstruct.ContactCustomerService, error) {
|
||||
list, err := p.store.GetContactCustomerServiceListUnread(ctx, req)
|
||||
func (p *ContactCustomerService) OpListUnread(ctx *gin.Context, req *contact_customer_serviceproto.OpListUnreadReq) ([]*dbstruct.ContactCustomerService, error) {
|
||||
list, err := p.store.GetUnreadContactCustomerServiceList(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("GetContactCustomerServiceListUnread fail, err: %v", err)
|
||||
logger.Error("GetUnreadContactCustomerServiceList fail, err: %v", err)
|
||||
return make([]*dbstruct.ContactCustomerService, 0), err
|
||||
}
|
||||
return list, nil
|
||||
}
|
||||
|
||||
func (p *ContactCustomerService) OpListByMid(ctx *gin.Context, req *contact_customer_serviceproto.OpListByMidReq) ([]*dbstruct.ContactCustomerService, error) {
|
||||
list, err := p.store.GetContactCustomerServiceListByMid(ctx, req)
|
||||
func (p *ContactCustomerService) OpListBySessionId(ctx *gin.Context, req *contact_customer_serviceproto.OpListBySessionIdReq) ([]*dbstruct.ContactCustomerService, error) {
|
||||
list, err := p.store.GetContactCustomerServiceListBySessionId(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("GetContactCustomerServiceListByMid fail, err: %v", err)
|
||||
logger.Error("GetContactCustomerServiceListBySessionId fail, err: %v", err)
|
||||
return make([]*dbstruct.ContactCustomerService, 0), err
|
||||
}
|
||||
return list, nil
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package logic
|
||||
|
||||
import (
|
||||
"service/api/consts"
|
||||
contact_customer_service_sessionproto "service/api/proto/contact_customer_service_session/proto"
|
||||
"service/app/mix/dao"
|
||||
"service/dbstruct"
|
||||
"service/library/logger"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
goproto "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type ContactCustomerServiceSession struct {
|
||||
store *dao.Store
|
||||
}
|
||||
|
||||
func NewContactCustomerServiceSession(store *dao.Store) (a *ContactCustomerServiceSession) {
|
||||
a = &ContactCustomerServiceSession{
|
||||
store: store,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (p *ContactCustomerServiceSession) OpCreate(ctx *gin.Context, req *contact_customer_service_sessionproto.OpCreateReq) error {
|
||||
|
||||
//生成自增id
|
||||
sessionSeqId, err := p.store.GetAndUpdateContactCustomerServiceSessionIdSeq(ctx)
|
||||
if err != nil {
|
||||
logger.Error("GetAndUpdateContactCustomerServiceSessionIdSeq fail, err: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
req.ContactCustomerServiceSession.Id = goproto.Int64(sessionSeqId.Seq)
|
||||
req.ContactCustomerServiceSession.Ct = goproto.Int64(time.Now().Unix())
|
||||
req.ContactCustomerServiceSession.Ut = goproto.Int64(time.Now().Unix())
|
||||
req.ContactCustomerServiceSession.DelFlag = goproto.Int64(consts.Exist)
|
||||
err = p.store.CreateContactCustomerServiceSession(ctx, req.ContactCustomerServiceSession)
|
||||
if err != nil {
|
||||
logger.Error("CreateContactCustomerServiceSession fail, err: %v", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ContactCustomerServiceSession) OpUpdate(ctx *gin.Context, req *contact_customer_service_sessionproto.OpUpdateReq) error {
|
||||
err := p.store.UpdateContactCustomerServiceSession(ctx, req.ContactCustomerServiceSession)
|
||||
if err != nil {
|
||||
logger.Error("UpdateContactCustomerServiceSession fail, err: %v", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ContactCustomerServiceSession) OpListByMid(ctx *gin.Context, req *contact_customer_service_sessionproto.OpListByMidReq) (*dbstruct.ContactCustomerServiceSession, error) {
|
||||
session, err := p.store.GetContactCustomerServiceSessionListByMid(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("GetContactCustomerServiceSessionList fail, err: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
return session, nil
|
||||
}
|
||||
|
||||
func (p *ContactCustomerServiceSession) OpList(ctx *gin.Context, req *contact_customer_service_sessionproto.OpListReq) ([]*dbstruct.ContactCustomerServiceSession, error) {
|
||||
list, err := p.store.GetContactCustomerServiceSessionList(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("GetContactCustomerServiceSessionList fail, err: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
return list, nil
|
||||
}
|
|
@ -6,6 +6,7 @@ import (
|
|||
accountrelationproto "service/api/proto/accountrelation/proto"
|
||||
callhistoryproto "service/api/proto/callhistory/proto"
|
||||
contact_customer_service_proto "service/api/proto/contact_customer_service/proto"
|
||||
contact_customer_service_sessionproto "service/api/proto/contact_customer_service_session/proto"
|
||||
feedbackproto "service/api/proto/feedback/proto"
|
||||
imageaudittaskproto "service/api/proto/imageaudittask/proto"
|
||||
loginproto "service/api/proto/login/proto"
|
||||
|
@ -919,7 +920,7 @@ func (s *Service) OpUpdateContactCustomerServiceByIdsBusinessValidate(ctx *gin.C
|
|||
return
|
||||
}
|
||||
|
||||
func (s *Service) OpGetContactCustomerServiceListByMidBusinessValidate(ctx *gin.Context, req *contact_customer_service_proto.OpListByMidReq) (ec errcode.ErrCode) {
|
||||
func (s *Service) OpGetContactCustomerServiceListBySessionIdBusinessValidate(ctx *gin.Context, req *contact_customer_service_proto.OpListBySessionIdReq) (ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvOk
|
||||
|
||||
// 1.业务校验
|
||||
|
@ -930,13 +931,13 @@ func (s *Service) OpGetContactCustomerServiceListByMidBusinessValidate(ctx *gin.
|
|||
Validate().
|
||||
Collect()
|
||||
if ec = result[0].(errcode.ErrCode); ec != errcode.ErrCodeOk {
|
||||
logger.Error("OpGetContactCustomerServiceListByMid business validation failed")
|
||||
logger.Error("OpGetContactCustomerServiceListBySessionId business validation failed")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Service) OpGetContactCustomerServiceListUnreadGroupByMidBusinessValidate(ctx *gin.Context, req *contact_customer_service_proto.OpListReq) (ec errcode.ErrCode) {
|
||||
func (s *Service) OpGetContactCustomerServiceListUnreadGroupByMidBusinessValidate(ctx *gin.Context, req *contact_customer_service_proto.OpListUnreadReq) (ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvOk
|
||||
|
||||
// 1.业务校验
|
||||
|
@ -1020,3 +1021,54 @@ func (s *Service) OpPassTextAuditTaskBatchBusinessValidate(ctx *gin.Context, req
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Service) OpCreateContactCustomerServiceSessionBusinessValidate(ctx *gin.Context, req *contact_customer_service_sessionproto.OpCreateReq) (ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvOk
|
||||
|
||||
// 1.业务校验
|
||||
result := businessvalidator.NewAuthBusinessValidator(ctx, req).
|
||||
QueryAccount(_DefaultAccount.OpListByMid).
|
||||
EnsureAccountExist().
|
||||
EnsureIsOpRole().
|
||||
Validate().
|
||||
Collect()
|
||||
if ec = result[0].(errcode.ErrCode); ec != errcode.ErrCodeOk {
|
||||
logger.Error("OpCreateContactCustomerServiceSession business validation failed")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Service) OpGetContactCustomerServiceSessionListByMidBusinessValidate(ctx *gin.Context, req *contact_customer_service_sessionproto.OpListByMidReq) (ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvOk
|
||||
|
||||
// 1.业务校验
|
||||
result := businessvalidator.NewAuthBusinessValidator(ctx, req).
|
||||
QueryAccount(_DefaultAccount.OpListByMid).
|
||||
EnsureAccountExist().
|
||||
EnsureIsOpRole().
|
||||
Validate().
|
||||
Collect()
|
||||
if ec = result[0].(errcode.ErrCode); ec != errcode.ErrCodeOk {
|
||||
logger.Error("OpGetContactCustomerServiceSessionListByMid business validation failed")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Service) OpGetContactCustomerServiceSessionListBusinessValidate(ctx *gin.Context, req *contact_customer_service_sessionproto.OpListReq) (ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvOk
|
||||
|
||||
// 1.业务校验
|
||||
result := businessvalidator.NewAuthBusinessValidator(ctx, req).
|
||||
QueryAccount(_DefaultAccount.OpListByMid).
|
||||
EnsureAccountExist().
|
||||
EnsureIsOpRole().
|
||||
Validate().
|
||||
Collect()
|
||||
if ec = result[0].(errcode.ErrCode); ec != errcode.ErrCodeOk {
|
||||
logger.Error("OpGetContactCustomerServiceSessionList business validation failed")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
callhistoryproto "service/api/proto/callhistory/proto"
|
||||
catalogproto "service/api/proto/catalog/proto"
|
||||
contact_customer_service_proto "service/api/proto/contact_customer_service/proto"
|
||||
contact_customer_service_sessionproto "service/api/proto/contact_customer_service_session/proto"
|
||||
feedbackproto "service/api/proto/feedback/proto"
|
||||
footprintproto "service/api/proto/footprint/proto"
|
||||
imageauditproto "service/api/proto/imageaudit/proto"
|
||||
|
@ -62,33 +63,34 @@ var (
|
|||
)
|
||||
|
||||
var (
|
||||
_DefaultToken *logic.Token
|
||||
_DefaultVeriCode *logic.VeriCode
|
||||
_DefaultAccount *logic.Account
|
||||
_DefaultProduct *logic.Product
|
||||
_DefaultCatalog *logic.Catalog
|
||||
_DefaultVas *logic.Vas
|
||||
_DefaultResource *logic.Resource
|
||||
_DefaultBanner *logic.Banner
|
||||
_DefaultLogin *logic.Login
|
||||
_DefaultMoment *logic.Moment
|
||||
_DefaultFootPrint *logic.FootPrint
|
||||
_DefaultThumbsUp *logic.ThumbsUp
|
||||
_DefaultAccountRelation *logic.AccountRelation
|
||||
_DefaultStreamerAuthApproval *logic.StreamerAuthApproval
|
||||
_DefaultStreamer *logic.Streamer
|
||||
_DefaultMedia *logic.Media
|
||||
_DefaultFeedback *logic.Feedback
|
||||
_DefaultCallHistory *logic.CallHistory
|
||||
_DefaultStreamerLink *logic.StreamerLink
|
||||
_DefaultUserWxAddCheck *logic.UserWxAddCheck
|
||||
_DefaultUserId *logic.UserIdSeq
|
||||
_DefaultRealNameAuthentication *logic.RealNameAuthentication
|
||||
_DefaultContactCustomerService *logic.ContactCustomerService
|
||||
_DefaultImageAudit *logic.ImageAudit
|
||||
_DefaultImageAuditTask *logic.ImageAuditTask
|
||||
_DefaultTextAudit *logic.TextAudit
|
||||
_DefaultTextAuditTask *logic.TextAuditTask
|
||||
_DefaultToken *logic.Token
|
||||
_DefaultVeriCode *logic.VeriCode
|
||||
_DefaultAccount *logic.Account
|
||||
_DefaultProduct *logic.Product
|
||||
_DefaultCatalog *logic.Catalog
|
||||
_DefaultVas *logic.Vas
|
||||
_DefaultResource *logic.Resource
|
||||
_DefaultBanner *logic.Banner
|
||||
_DefaultLogin *logic.Login
|
||||
_DefaultMoment *logic.Moment
|
||||
_DefaultFootPrint *logic.FootPrint
|
||||
_DefaultThumbsUp *logic.ThumbsUp
|
||||
_DefaultAccountRelation *logic.AccountRelation
|
||||
_DefaultStreamerAuthApproval *logic.StreamerAuthApproval
|
||||
_DefaultStreamer *logic.Streamer
|
||||
_DefaultMedia *logic.Media
|
||||
_DefaultFeedback *logic.Feedback
|
||||
_DefaultCallHistory *logic.CallHistory
|
||||
_DefaultStreamerLink *logic.StreamerLink
|
||||
_DefaultUserWxAddCheck *logic.UserWxAddCheck
|
||||
_DefaultUserId *logic.UserIdSeq
|
||||
_DefaultRealNameAuthentication *logic.RealNameAuthentication
|
||||
_DefaultContactCustomerService *logic.ContactCustomerService
|
||||
_DefaultImageAudit *logic.ImageAudit
|
||||
_DefaultImageAuditTask *logic.ImageAuditTask
|
||||
_DefaultTextAudit *logic.TextAudit
|
||||
_DefaultTextAuditTask *logic.TextAuditTask
|
||||
_DefaultContactCustomerServiceSession *logic.ContactCustomerServiceSession
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
|
@ -152,6 +154,7 @@ func (s *Service) Init(c any) (err error) {
|
|||
_DefaultImageAuditTask = logic.NewImageAuditTask(store)
|
||||
_DefaultTextAudit = logic.NewTextAudit(store)
|
||||
_DefaultTextAuditTask = logic.NewTextAuditTask(store)
|
||||
_DefaultContactCustomerServiceSession = logic.NewContactCustomerServiceSession(store)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -2190,12 +2193,23 @@ func (s *Service) OpCreateContactCustomerService(ctx *gin.Context, req *contact_
|
|||
return
|
||||
}
|
||||
|
||||
err := _DefaultContactCustomerService.OpCreate(ctx, req)
|
||||
if err != nil {
|
||||
if err := _DefaultContactCustomerService.OpCreate(ctx, req); err != nil {
|
||||
logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvFail
|
||||
return
|
||||
}
|
||||
|
||||
//更新session表的内容
|
||||
if err := _DefaultContactCustomerServiceSession.OpUpdate(ctx, &contact_customer_service_sessionproto.OpUpdateReq{
|
||||
ContactCustomerServiceSession: &dbstruct.ContactCustomerServiceSession{
|
||||
Id: req.SessionId,
|
||||
RecentMessage: req.Message,
|
||||
},
|
||||
}); err != nil {
|
||||
logger.Error("Update session fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvFail
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -2220,34 +2234,23 @@ func (s *Service) OpUpdateContactCustomerServiceByIds(ctx *gin.Context, req *con
|
|||
return
|
||||
}
|
||||
|
||||
func (s *Service) OpDeleteContactCustomerService(ctx *gin.Context, id int64) (ec errcode.ErrCode) {
|
||||
func (s *Service) OpGetContactCustomerServiceListBySessionId(ctx *gin.Context, req *contact_customer_service_proto.OpListBySessionIdReq) (list []*dbstruct.ContactCustomerService, ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvOk
|
||||
err := _DefaultContactCustomerService.OpDelete(ctx, id)
|
||||
|
||||
if ec = s.OpGetContactCustomerServiceListBySessionIdBusinessValidate(ctx, req); ec != errcode.ErrCodeContactCustomerServiceSrvOk {
|
||||
return
|
||||
}
|
||||
|
||||
list, err := _DefaultContactCustomerService.OpListBySessionId(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("OpDelete fail, id: %v, err: %v", id, err)
|
||||
logger.Error("OpGetContactCustomerServiceListBySessionId fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvFail
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Service) OpGetContactCustomerServiceListByMid(ctx *gin.Context, req *contact_customer_service_proto.OpListByMidReq) (list []*dbstruct.ContactCustomerService, ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvOk
|
||||
|
||||
if ec = s.OpGetContactCustomerServiceListByMidBusinessValidate(ctx, req); ec != errcode.ErrCodeContactCustomerServiceSrvOk {
|
||||
return
|
||||
}
|
||||
|
||||
list, err := _DefaultContactCustomerService.OpListByMid(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("OpGetContactCustomerServiceListByMid fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvFail
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Service) OpGetContactCustomerServiceListUnreadGroupByMid(ctx *gin.Context, req *contact_customer_service_proto.OpListReq) (volist []*contact_customer_service_proto.ContactCustomerServiceOpVO, ec errcode.ErrCode) {
|
||||
func (s *Service) OpGetContactCustomerServiceListUnreadGroupByMid(ctx *gin.Context, req *contact_customer_service_proto.OpListUnreadReq) (volist []*contact_customer_service_proto.ContactCustomerServiceOpUnreadVO, ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSrvOk
|
||||
|
||||
if ec = s.OpGetContactCustomerServiceListUnreadGroupByMidBusinessValidate(ctx, req); ec != errcode.ErrCodeContactCustomerServiceSrvOk {
|
||||
|
@ -2263,17 +2266,17 @@ func (s *Service) OpGetContactCustomerServiceListUnreadGroupByMid(ctx *gin.Conte
|
|||
|
||||
_map := make(map[int64][]*dbstruct.ContactCustomerService)
|
||||
for _, contact_customer_service := range list {
|
||||
subMid := util.DerefInt64(contact_customer_service.SubMid)
|
||||
contents := _map[subMid]
|
||||
_map[subMid] = append(contents, contact_customer_service)
|
||||
sessionId := util.DerefInt64(contact_customer_service.SessionId)
|
||||
contents := _map[sessionId]
|
||||
_map[sessionId] = append(contents, contact_customer_service)
|
||||
}
|
||||
|
||||
index := 0
|
||||
volist = make([]*contact_customer_service_proto.ContactCustomerServiceOpVO, len(_map))
|
||||
for mid, contents := range _map {
|
||||
volist[index] = &contact_customer_service_proto.ContactCustomerServiceOpVO{
|
||||
Mid: mid,
|
||||
List: contents,
|
||||
volist = make([]*contact_customer_service_proto.ContactCustomerServiceOpUnreadVO, len(_map))
|
||||
for sessionId, contents := range _map {
|
||||
volist[index] = &contact_customer_service_proto.ContactCustomerServiceOpUnreadVO{
|
||||
SessionId: sessionId,
|
||||
List: contents,
|
||||
}
|
||||
index++
|
||||
}
|
||||
|
@ -2417,3 +2420,54 @@ func (s *Service) OpPassTextAuditTaskBatch(ctx *gin.Context, req *textaudittaskp
|
|||
|
||||
return
|
||||
}
|
||||
|
||||
// ContactCustomerServiceSession
|
||||
func (s *Service) OpCreateContactCustomerServiceSession(ctx *gin.Context, req *contact_customer_service_sessionproto.OpCreateReq) (ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvOk
|
||||
|
||||
if ec = s.OpCreateContactCustomerServiceSessionBusinessValidate(ctx, req); ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk {
|
||||
return
|
||||
}
|
||||
|
||||
err := _DefaultContactCustomerServiceSession.OpCreate(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvFail
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Service) OpGetContactCustomerServiceSessionListByMid(ctx *gin.Context, req *contact_customer_service_sessionproto.OpListByMidReq) (session *dbstruct.ContactCustomerServiceSession, ec errcode.ErrCode) {
|
||||
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvOk
|
||||
|
||||
if ec = s.OpGetContactCustomerServiceSessionListByMidBusinessValidate(ctx, req); ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk {
|
||||
return
|
||||
}
|
||||
|
||||
session, err := _DefaultContactCustomerServiceSession.OpListByMid(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("OpListByMid fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvFail
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Service) OpGetContactCustomerServiceSessionList(ctx *gin.Context, req *contact_customer_service_sessionproto.OpListReq) (list []*dbstruct.ContactCustomerServiceSession, ec errcode.ErrCode) {
|
||||
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvOk
|
||||
|
||||
if ec = s.OpGetContactCustomerServiceSessionListBusinessValidate(ctx, req); ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk {
|
||||
return
|
||||
}
|
||||
|
||||
list, err := _DefaultContactCustomerServiceSession.OpList(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("OpList fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeContactCustomerServiceSessionSrvFail
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -9,13 +9,13 @@ import (
|
|||
func main() {
|
||||
|
||||
genSource := &generator.GenSource{
|
||||
EntityName: "ImageAuditTask",
|
||||
ModuleName: "imageaudittask",
|
||||
EntityCNName: "图片审核任务",
|
||||
ErrCodeSeq: "21",
|
||||
EntityName: "ContactCustomerServiceSession",
|
||||
ModuleName: "contact_customer_service_session",
|
||||
EntityCNName: "联系客服对话表",
|
||||
ErrCodeSeq: "24",
|
||||
}
|
||||
|
||||
// generator.CreateFileDirectory(genSource)
|
||||
generator.CreateFileDirectory(genSource)
|
||||
|
||||
// genSource.InPath = consts.EntityInPath
|
||||
// genSource.OutPath = fmt.Sprintf("%v%v%v.go", consts.RootPath, consts.EntityOutPath, genSource.ModuleName)
|
||||
|
@ -29,9 +29,9 @@ func main() {
|
|||
// genSource.OutPath = fmt.Sprintf("%v%v%v_mongo.go", consts.RootPath, consts.MongoOutPath, genSource.ModuleName)
|
||||
// generator.GenerateModule(genSource)
|
||||
|
||||
// genSource.InPath = consts.ProtoInPath
|
||||
// genSource.OutPath = fmt.Sprintf("%v%v%v/proto/%v_op.go", consts.RootPath, consts.ProtoOutPath, genSource.ModuleName, genSource.ModuleName)
|
||||
// generator.GenerateModule(genSource)
|
||||
genSource.InPath = consts.ProtoInPath
|
||||
genSource.OutPath = fmt.Sprintf("%v%v%v/proto/%v_op.go", consts.RootPath, consts.ProtoOutPath, genSource.ModuleName, genSource.ModuleName)
|
||||
generator.GenerateModule(genSource)
|
||||
|
||||
// genSource.InPath = consts.ServiceInPath
|
||||
// genSource.OutPath = fmt.Sprintf("%v%v%v.go", consts.RootPath, consts.ServiceOutPath, genSource.ModuleName)
|
||||
|
@ -45,12 +45,12 @@ func main() {
|
|||
// genSource.OutPath = fmt.Sprintf("%v%v%v_errcode.go", consts.RootPath, consts.ErrcodeOutPath, genSource.ModuleName)
|
||||
// generator.GenerateModule(genSource)
|
||||
|
||||
genSource.InPath = consts.ControllerInPath
|
||||
genSource.OutPath = fmt.Sprintf("%v%v%v_op.go", consts.RootPath, consts.ControllerOutPath, genSource.ModuleName)
|
||||
generator.GenerateModule(genSource)
|
||||
// genSource.InPath = consts.ControllerInPath
|
||||
// genSource.OutPath = fmt.Sprintf("%v%v%v_op.go", consts.RootPath, consts.ControllerOutPath, genSource.ModuleName)
|
||||
// generator.GenerateModule(genSource)
|
||||
|
||||
genSource.InPath = consts.ControllerCenterInPath
|
||||
genSource.OutPath = fmt.Sprintf("%v%v%v_controller_center.go", consts.RootPath, consts.ControllerCenterOutPath, genSource.ModuleName)
|
||||
generator.GenerateModule(genSource)
|
||||
// genSource.InPath = consts.ControllerCenterInPath
|
||||
// genSource.OutPath = fmt.Sprintf("%v%v%v_controller_center.go", consts.RootPath, consts.ControllerCenterOutPath, genSource.ModuleName)
|
||||
// generator.GenerateModule(genSource)
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package consts
|
||||
|
||||
// root
|
||||
const RootPath = "/Users/PC/Desktop/wishpal-ironfan/"
|
||||
const RootPath = "/Users/PC/Desktop/wishpal_ironfan_service/service/"
|
||||
|
||||
const ExcelPath = "codecreate/resource/EntityDefine.xlsx"
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,14 +1,13 @@
|
|||
package dbstruct
|
||||
|
||||
type ContactCustomerService struct {
|
||||
Id *int64 `json:"id" bson:"_id"` // 实名认证表id
|
||||
SubMid *int64 `json:"sub_mid" bson:"sub_mid"` // 主语mid(请求人)
|
||||
ObjMid *int64 `json:"obj_mid" bson:"obj_mid"` // 宾语mid(处理人)
|
||||
Predicate *int64 `json:"predicate" bson:"predicate"` // 谓词
|
||||
Message *string `json:"message" bson:"message"` // 发送信息
|
||||
IsRead *int64 `json:"is_read" bson:"is_read"` // 是否已读
|
||||
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
|
||||
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
|
||||
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
|
||||
Id *int64 `json:"id" bson:"_id"` // 联系客服表id
|
||||
SessionId *int64 `json:"session_id" bson:"session_id"` // sessionId
|
||||
Predicate *int64 `json:"predicate" bson:"predicate"` // 谓词,0-联系客服,1-客服处理
|
||||
Message *string `json:"message" bson:"message"` // 发送信息
|
||||
IsRead *int64 `json:"is_read" bson:"is_read"` // 是否已读
|
||||
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
|
||||
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
|
||||
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package dbstruct
|
||||
|
||||
type ContactCustomerServiceSession struct {
|
||||
Id *int64 `json:"id" bson:"_id"` // Session表id
|
||||
SubMid *int64 `json:"sub_mid" bson:"sub_mid"` // 主语mid
|
||||
ObjMid *int64 `json:"obj_mid" bson:"obj_mid"` // 宾语mid
|
||||
RecentMessage *string `json:"recent_message" bson:"recent_message"` // 最近消息
|
||||
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
|
||||
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
|
||||
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
|
||||
|
||||
}
|
|
@ -41,6 +41,10 @@ type ContactCustomerServiceIdSeq struct {
|
|||
Seq int64 //联系客服ID序列号
|
||||
}
|
||||
|
||||
type ContactCustomerServiceSessionIdSeq struct {
|
||||
Seq int64 //联系客服对话ID序列号
|
||||
}
|
||||
|
||||
type MediaIdSeq struct {
|
||||
Seq int64 `json:"seq" bson:"seq"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue