service

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// code.SUCCESS_CODE   = 0     //成功的状态码
	// BAD_LOGIN      = 10001 //登录失败
	// BAD_REQUEST    = 10002 //参数错误
	// PERMISSION_ERR = 10003 //权限校验错误
	// FAIL_CODE      = 20001 //失败的状态码
	BUSINESS_ERR = 20002 //业务错误
	// NULL_ERR       = 20003 //无数据错误
	// DATABASE_ERR   = 20004 //数据库异常
	// CACHE_ERR      = 20005 //缓存异常
	USER_UID_KEY           = "UID" //页面UUID键名
	SUPER_ADMIN_ID         = "10"  //超级管理员
	ReqSelKeyLimitLang int = 38    //首页搜索字数限制
)
View Source
const ReturnSuccess = "S0000001"

Variables

This section is empty.

Functions

func RequestParams

func RequestParams(c *gin.Context) map[string]interface{}

func ResBadRequest

func ResBadRequest(c *gin.Context, msg string)

参数错误

func ResBadRequest1

func ResBadRequest1(c *gin.Context, msg string)

参数错误

func ResBadRequestByApc

func ResBadRequestByApc(c *gin.Context, msg string)

ResBadRequestByApc 参数错误-只针对 采购推荐系统

func ResBadRequestMsg

func ResBadRequestMsg(c *gin.Context, msg string, v interface{})

参数错误

func ResBusinessButSuccessP

func ResBusinessButSuccessP(c *gin.Context, msg string)

业务错误 提示错误信息

func ResBusinessP

func ResBusinessP(c *gin.Context, msg string)

业务错误 提示错误信息

func ResDataErrorMsg

func ResDataErrorMsg(c *gin.Context, msg string, v interface{})

响应成功

func ResDataSuccessMsg

func ResDataSuccessMsg(c *gin.Context, msg string, v interface{})

响应成功

func ResErrCli

func ResErrCli(c *gin.Context, err error)

响应错误-用户端故障

func ResErrSrv

func ResErrSrv(c *gin.Context)

响应错误-服务端故障

func ResJSON

func ResJSON(c *gin.Context, status int, v interface{})

响应JSON数据

func ResPermission

func ResPermission(c *gin.Context, msg string)

权限错误

func ResReturnCode

func ResReturnCode(c *gin.Context, v interface{})

func ResSuccess

func ResSuccess(c *gin.Context, v interface{})

响应成功

func ResSuccessMsg

func ResSuccessMsg(c *gin.Context, msg string)

响应成功

func ResSuccessMsgByApc

func ResSuccessMsgByApc(c *gin.Context, msg, flag string, v interface{})

ResSuccessMsgByApc 响应成功-只针对 采购推荐系统

func ResSuccessMsgOfNullErr

func ResSuccessMsgOfNullErr(c *gin.Context, msg string, v interface{})

响应成功-无数据

func ResSuccessPage

func ResSuccessPage(c *gin.Context, indexPage orm.IndexPage, list interface{})

响应成功-分页数据

Types

type IdsReq

type IdsReq struct {
	Ids []string `json:"Ids"  binding:"required" ` //id 列表
}

请求公共结构体

type KnowledgeListReq

type KnowledgeListReq struct {
	ListReq
	Guid string `json:"guid" form:"guid"` // cm_proc_plan_in 专用
	Type string `json:"type" form:"type"` // 搜索类型
}

func (*KnowledgeListReq) GetListQueryV3

func (l *KnowledgeListReq) GetListQueryV3(c *gin.Context) (string, []string, error)

组装阿里云搜索sql(首页)

type ListReq

type ListReq struct {
	Page      int    `json:"page" form:"page" `          //页数
	Num       int    `json:"num"  form:"num" `           //数量
	Key       string `json:"key" form:"key" `            //搜索关键字
	Sort      string `json:"sort" form:"sort"`           //排序字段
	OrderType string `json:"orderType" form:"orderType"` //排序规则
	BeginAt   string `json:"beginAt" form:"beginAt" `    //开始时间
	EndAt     string `json:"endAt" form:"endAt" `        //结束时间

}

func (*ListReq) GetListQuery

func (l *ListReq) GetListQuery(c *gin.Context) (err error)

func (*ListReq) GetListQueryV2

func (l *ListReq) GetListQueryV2(c *gin.Context) (err error)

func (*ListReq) GetListQueryV4

func (l *ListReq) GetListQueryV4(c *gin.Context) (err error)

func (*ListReq) GetPostListQuery

func (l *ListReq) GetPostListQuery(c *gin.Context) (err error)

type ListReqAddOth

type ListReqAddOth struct {
	ListReq
	Guid        string `json:"guid" form:"guid"`
	ProjectCode string `json:"project_code" form:"project_code"`
}

func (*ListReqAddOth) GetListQueryV4

func (l *ListReqAddOth) GetListQueryV4(c *gin.Context) (err error)

type ListReqForApc

type ListReqForApc struct {
	Num            int    `json:"num"  form:"num" `                           //数量
	Page           int    `json:"page" form:"page" `                          //页数
	BeginAt        string `json:"beginAt" form:"beginAt" `                    //开始时间
	EndAt          string `json:"endAt" form:"endAt" `                        //结束时间
	PlanInDetailID int64  `json:"plan_in_detail_id" form:"plan_in_detail_id"` // 采购详情ID
}

func (*ListReqForApc) GetListQuery

func (l *ListReqForApc) GetListQuery(c *gin.Context) (err error)

type ListRequest

type ListRequest struct {
	Page    int `json:"page" form:"page"`
	PerPage int `json:"per_page" form:"per_page"`
	Sort    int `json:"sort" form:"sort"`
}

type Paginator

type Paginator struct {
	TotalCount int         `json:"total_count"`
	TotalPage  int         `json:"total_page"`
	Data       interface{} `json:"data"`
	PerPage    int         `json:"per_page"`
	Page       int         `json:"page"`
}

func Paging

func Paging(p *Param, result interface{}, args ...interface{}) (*Paginator, error)

Paging 分页

type Param

type Param struct {
	C       *gin.Context
	DB      *gorm.DB
	ShowSQL bool
}

type ResponseModel

type ResponseModel struct {
	Code    int         `json:"code"`
	Message string      `json:"msg"`
	Data    interface{} `json:"data,omitempty"`
}

type ResponseModel1

type ResponseModel1 struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type ResponseModelByApc

type ResponseModelByApc struct {
	ResponseModel
	Flag string `json:"flag"`
}

返回结果只针对 采购推荐可视化 的 电信短信返回值

type ResponsePage

type ResponsePage struct {
	Code    int              `json:"code"`
	Message string           `json:"msg"`
	Data    ResponsePageData `json:"data"`
}

type ResponsePageData

type ResponsePageData struct {
	IndexPage orm.IndexPage `json:"index"`
	Res       interface{}   `json:"res"`
}

type ReturnCode

type ReturnCode struct {
	ReturnCode string      `json:"RETURN_CODE"`
	ReturnDesc string      `json:"RETURN_DESC"`
	Code       int         `json:"code"`
	Message    string      `json:"msg"`
	Data       interface{} `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL