feat(app): update

This commit is contained in:
Yangtao
2025-11-19 14:24:13 +08:00
parent 1eac66d7fd
commit 0c34585649
329 changed files with 10760 additions and 281 deletions

View File

@ -0,0 +1,125 @@
package request
import "errors"
type ReportUserRequest struct {
BaseRequest
TargetUserId string
Reason string // 举报原因
PicUrls string
ContentExt string
}
// 参数合法性检验
func (request *ReportUserRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId不能为空")
return
}
if len(request.Reason) == 0 {
err = errors.New("Reason不能为空")
return
}
return
}
type UserTicketRequest struct {
BaseRequest
TicketType string // 工单类型
ComplaintType string // 投诉类型
TargetUserId string // 目标用户ID
OrderNo string // 关联订单号
Title string // 标题
Reason string // 售后原因
Content string // 内容
PicUrls string // 图片链接,逗号分隔
}
// 参数合法性检验
func (request *UserTicketRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TicketType) == 0 {
err = errors.New("TicketType不能为空")
return
}
if len(request.TicketType) == 0 {
err = errors.New("Title不能为空")
return
}
return
}
type UserReplyTicketRequest struct {
BaseRequest
TicketId string // 工单ID
Content string // 内容
PicUrls string // 图片链接,逗号分隔
}
// 参数合法性检验
func (request *UserReplyTicketRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Content) == 0 && len(request.PicUrls) == 0 {
err = errors.New("内容不能为空")
return
}
return
}
type GetUserTicketPage struct {
BaseRequest
TicketType string // 工单类型 complaint=投诉 suggestion=建议
PageNo string // 页码
PageSize string // 页长
}
// 参数合法性检验
func (request *GetUserTicketPage) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.PageNo) == 0 {
err = errors.New("PageNo不能为空")
return
}
if len(request.PageSize) == 0 {
err = errors.New("PageSize不能为空")
return
}
return
}
type GetUserTicketDetail struct {
BaseRequest
TicketId string
}
// 参数合法性检验
func (request *GetUserTicketDetail) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TicketId) == 0 {
err = errors.New("TicketId不能为空")
return
}
return
}