1 Star 0 Fork 0

gabbble/app

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
appQuestionFeedbackLogic.go 1.43 KB
Copy Edit Raw Blame History
haozhiyuan0204 authored 2023-11-25 13:37 +08:00 . modify
package logic
import (
"context"
"database/sql"
"gitee.com/gabbble/app/model/mysql"
"gitee.com/gabbble/comm_pkg/common/constant"
"gitee.com/gabbble/comm_pkg/utils"
"time"
"gitee.com/gabbble/app/apppb"
"gitee.com/gabbble/app/internal/svc"
"github.com/zeromicro/go-zero/core/logx"
)
type AppQuestionFeedbackLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewAppQuestionFeedbackLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AppQuestionFeedbackLogic {
return &AppQuestionFeedbackLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *AppQuestionFeedbackLogic) AppQuestionFeedback(in *apppb.AppQuestionFeedbackReq) (*apppb.AppQuestionFeedbackRsp, error) {
fun := utils.GetSelfFuncName() + " --"
_, err := l.svcCtx.ModelInstQuestionFeedback.Insert(l.ctx, &mysql.AppQuestionFeedback{
Id: 0,
Uid: in.Uid,
Uuid: in.Uuid,
Platform: constant.PlatformIDToName(int(in.Platform)),
Email: in.Email,
Content: sql.NullString{
String: in.Content,
Valid: true,
},
Ctime: time.Now().Unix(),
})
if err != nil {
logx.WithContext(l.ctx).Infof("%s Insert Fail: %v, req: %+v", fun, err, in)
return &apppb.AppQuestionFeedbackRsp{
ErrInfo: &apppb.ErrorInfo{
ErrCode: -1,
ErrMsg: err.Error(),
},
}, nil
}
return &apppb.AppQuestionFeedbackRsp{
ErrInfo: &apppb.ErrorInfo{
ErrCode: 0,
ErrMsg: "success",
},
}, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/gabbble/app.git
git@gitee.com:gabbble/app.git
gabbble
app
app
9a5bcbd7ccf5

Search