resource

package
v0.0.0-...-a966c5d Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSG_TYPE_FAULT_NOTIFY = uint8(1)
	//MSG_TYPE_FAULT_ORDER  = uint8(2)
	//MSG_TYPE_FOLLOW       = uint8(3)
	MSG_TYPE_FAULT_STS    = uint8(2)
	MST_TYPE_PROJ_STS     = uint8(3)
	MSG_TYPE_FAULT_STAT   = uint8(4)
	MSG_TYPE_FAULT_REMARK = uint8(5)
)
View Source
const (
	ERRCODE_SUCCESS = 0
	ERRMSG_SUCCESS  = "success"
)

Variables

This section is empty.

Functions

func FileExists

func FileExists(name string) bool

FileExists reports whether the named file or directory exists.

func IsEmptyBody

func IsEmptyBody(c *gin.Context) bool

func SendVC

func SendVC(tel, vccode string) (string, bool)

Types

type APS

type APS struct {
	Alert            string `json:"alert"`
	ContentAvailable uint8  `json:"content-available"`
}

type APS1

type APS1 struct {
	Alert string `json:"alert"`
}

type CommonResource

type CommonResource struct {
}

func (*CommonResource) FindUser

func (cr *CommonResource) FindUser(userId int64) (*model.User, error)

func (*CommonResource) SetDB

func (cr *CommonResource) SetDB(gormDB gorm.DB)

type CommonResponse

type CommonResponse struct {
	ErrCode uint8  `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
}

type DataResource

type DataResource struct {
	DataPath string
}

func (*DataResource) Upload

func (d *DataResource) Upload(c *gin.Context)

type Empty

type Empty struct {
}

type FaultGetContent

type FaultGetContent struct {
	FaultId    int64      `json:"faultId"`
	Desc       string     `json:"desc"`
	Proj       model.Proj `json:"proj"`
	CTOID      *int64     `json:"ctoId,omitempty"`
	ENGID      *int64     `json:"engId,omitempty"`
	Sts        uint8      `json:"sts"`
	Level      uint8      `json:"level"`
	CreateDate *time.Time `json:"createDate,omitempty"`
}

type FaultGetContentV2

type FaultGetContentV2 struct {
	FaultId          int64     `json:"faultId"`
	Desc             *string   `json:"desc"`
	Sts              uint8     `json:"sts"`
	Level            uint8     `json:"level"`
	CreateDate       time.Time `json:"createDate"`
	ProjId           uint8     `json:"projId"`
	ProjMonitorType  *string   `json:"projMonitorType"`
	ProjName         *string   `json:"projName"`
	ProjCompany      *string   `json:"projCompany"`
	ProjAddr         *string   `json:"projAddr"`
	ProjDim          *string   `json:"projDim"`
	ProjBuildCompany *string   `json:"projBuildCompany,omitempty"`
	CTOId            *int64    `json:"ctoId,omitempty"`
	CTOName          *string   `json:"ctoName,omitempty"`
	CTOPhoto         *string   `json:"ctoPhoto,omitempty"`
	CTOOrgName       *string   `json:"ctoOrgName,omitempty"`
	CTOTel           *string   `json:"ctoTel,omitempty"`
	ENGId            *int64    `json:"engId,omitempty"`
	ENGName          *string   `json:"engName,omitempty"`
	ENGPhoto         *string   `json:"engPhoto,omitempty"`
	ENGTel           *string   `json:"engTel,omitempty"`
}

type FaultGetRequest

type FaultGetRequest struct {
	FaultId int64 `json:"faultId" binding:"required"`
}

type FaultGetResponse

type FaultGetResponse struct {
	ErrCode uint8              `json:"errCode"`
	ErrMsg  string             `json:"errMsg"`
	Content *FaultGetContentV2 `json:"content,omitempty" `
}

type FaultItem

type FaultItem struct {
	FaultId    int64      `json:"faultId"`
	Desc       string     `json:"desc"`
	Proj       model.Proj `json:"proj"`
	CTOID      *int64     `json:"ctoId,omitempty"`
	ENGID      *int64     `json:"engId,omitempty"`
	Sts        uint8      `json:"sts"`
	Level      uint8      `json:"level"`
	CreateDate *time.Time `json:"createDate,omitempty"`
}

type FaultItemV2

type FaultItemV2 struct {
	FaultId     int64      `json:"faultId"`
	Desc        *string    `json:"desc"`
	Sts         uint8      `json:"sts"`
	Level       uint8      `json:"level"`
	CreateDate  *time.Time `json:"createDate,omitempty"`
	ProjName    *string    `json:"projName"`
	ProjCompany *string    `json:"projCompany"`
}

type FaultListContent

type FaultListContent struct {
	Faults []FaultItemV2 `json:"faults,omitempty"`
}

type FaultListRequest

type FaultListRequest struct {
	FaultSts uint8 `json:"faultSts" binding:"required"`
	Offset   uint8 `json:"offset" `
	Limit    uint8 `json:"limit" binding:"required"`
}

type FaultListResponse

type FaultListResponse struct {
	ErrCode uint8             `json:"errCode"`
	ErrMsg  string            `json:"errMsg"`
	Content *FaultListContent `json:"content,omitempty"`
}

type FaultNotifyContent

type FaultNotifyContent struct {
	FaultId     int64      `json:"faultId"`
	Title       string     `json:"title"`
	Sts         uint8      `json:"sts"`
	Level       uint8      `json:"level"`
	CreateDate  *time.Time `json:"createDate"`
	ProjName    string     `json:"projName"`
	ProjCompany string     `json:"projCompany"`
}

type FaultOrderListContent

type FaultOrderListContent struct {
	Faults *[]OrderItem `json:"faults"`
}

type FaultOrderListRequest

type FaultOrderListRequest struct {
	Offset uint8 `json:"offset"`
	Limit  uint8 `json:"limit" binding:"required"`
}

type FaultOrderListResponse

type FaultOrderListResponse struct {
	ErrCode uint8                  `json:"errCode"`
	ErrMsg  string                 `json:"errMsg"`
	Content *FaultOrderListContent `json:"content,omitempty`
}

type FaultRemarkAddContent

type FaultRemarkAddContent struct {
	RemarkId int64 `json:"remarkId"`
}

type FaultRemarkAddRequest

type FaultRemarkAddRequest struct {
	FaultId    int64      `json:"faultId" binding:"required"`
	Remark     string     `json:"remark" binding:"required"`
	CreateDate *time.Time `json:"createDate"`
}

type FaultRemarkAddResponse

type FaultRemarkAddResponse struct {
	ErrCode uint8  `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
}

type FaultRemarkGetContent

type FaultRemarkGetContent struct {
	UserId     int64     `json:"userId"`
	Remark     string    `json:"remark"`
	CreateDate time.Time `json:"createDate"`
}

type FaultRemarkGetRequest

type FaultRemarkGetRequest struct {
	RemarkId int64 `json:"remarkId" binding:"required"`
}

type FaultRemarkGetResponse

type FaultRemarkGetResponse struct {
	ErrCode uint8                  `json:"errCode"`
	ErrMsg  string                 `json:"errMsg"`
	Content *FaultRemarkGetContent `json:"content,omitempty"`
}

type FaultRemarkListContent

type FaultRemarkListContent struct {
	Remarks *[]RemarkItem `json:"remarks"`
}

type FaultRemarkListRequest

type FaultRemarkListRequest struct {
	FaultId int64 `json:"faultId"`
}

type FaultRemarkListResponse

type FaultRemarkListResponse struct {
	ErrCode uint8                   `json:"errCode"`
	ErrMsg  string                  `json:"errMsg"`
	Content *FaultRemarkListContent `json:"content,omitempty"`
}

type FaultResource

type FaultResource struct {
	DB gorm.DB
}

func (*FaultResource) Get

func (fr *FaultResource) Get(c *gin.Context)

故障消息详情

func (*FaultResource) List

func (fr *FaultResource) List(c *gin.Context)

故障消息列表

func (*FaultResource) MessageDelete

func (fr *FaultResource) MessageDelete(c *gin.Context)

func (*FaultResource) MessageDeleteAll

func (fr *FaultResource) MessageDeleteAll(c *gin.Context)

func (*FaultResource) MessageList

func (fr *FaultResource) MessageList(c *gin.Context)

func (*FaultResource) MessageRead

func (fr *FaultResource) MessageRead(c *gin.Context)

func (*FaultResource) NotifyFault

func (fr *FaultResource) NotifyFault(c *gin.Context)

func (*FaultResource) OrderList

func (fr *FaultResource) OrderList(c *gin.Context)

工单列表

func (*FaultResource) RemarkAdd

func (fr *FaultResource) RemarkAdd(c *gin.Context)

func (*FaultResource) RemarkGet

func (fr *FaultResource) RemarkGet(c *gin.Context)

func (*FaultResource) RemarkList

func (fr *FaultResource) RemarkList(c *gin.Context)

func (*FaultResource) Stat

func (fr *FaultResource) Stat(c *gin.Context)

func (*FaultResource) Sts

func (fr *FaultResource) Sts(c *gin.Context)

type FaultStatContent

type FaultStatContent struct {
	S1 int `json:"s1"` //pending
	S2 int `json:"s2"` //issue
	S3 int `json:"s3"` //accept
	S4 int `json:"s4"` //complete
	S5 int `json:"s5"` //confirm
}

type FaultStatResponse

type FaultStatResponse struct {
	ErrCode uint8             `json:"errCode"`
	ErrMsg  string            `json:"errMsg"`
	Content *FaultStatContent `json:"content,omitempty"`
}

type FaultStsContent

type FaultStsContent struct {
	FaultId    int64     `json:"faultId"`
	Sts        uint8     `json:"sts"`
	CreateDate time.Time `json:"createDate"`
}

type FaultStsNotify

type FaultStsNotify struct {
	FaultId     int64      `json:"faultId"`
	Title       string     `json:"title"`
	Sts         uint8      `json:"sts"`
	Level       uint8      `json:"level"`
	CreateDate  *time.Time `json:"createDate"`
	ProjName    string     `json:"projName"`
	ProjCompany string     `json:"projCompany"`
}

type FaultStsRequest

type FaultStsRequest struct {
	FaultId int64 `json:"faultId" binding:"required"`
	Sts     uint8 `json:"sts" binding:"required"`
}

type FeedBackRequest

type FeedBackRequest struct {
	Content string `json:"content" binding:"required"`
}

type FindPwdByTelRequest

type FindPwdByTelRequest struct {
	Tel    string `json:"tel" binding:"required"`
	NewPwd string `json:"newpwd" binding:"required"`
	Vc     string `json:"vccode" binding:"required"`
}

type Follow

type Follow struct {
	FollowId   *int64        `json:"followId,omitempty"`
	UserId     int64         `json:"userId"`
	Name       string        `json:"name"`
	Photo      string        `json:"photo"`
	OrgName    string        `json:"orgName"`
	UserType   uint8         `json:"userType"`
	IsFollowed *uint8        `json:"isFollowed,omitempty"`
	Projs      *[]model.Proj `json:"projs,omitempty"`
}

type FollowAddContent

type FollowAddContent struct {
	FollowId int64 `json:"followId"`
}

type FollowAddRequest

type FollowAddRequest struct {
	UserId int64 `json:"userId" binding:"required"`
}

type FollowAddResponse

type FollowAddResponse struct {
	ErrCode uint8             `json:"errCode"`
	ErrMsg  string            `json:"errMsg"`
	Content *FollowAddContent `json:content,omitempty`
}

type FollowAgreeRequest

type FollowAgreeRequest struct {
	UserId   *int64   `json:"userId"  binding:"exists"`
	FollowId int64    `json:followId" binding:"required"`
	ProjIds  *[]int64 `json:"projIds"   binding:"exists"`
}

type FollowAgreeResponse

type FollowAgreeResponse struct {
	ErrCode uint8  `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
}

type FollowCancelRequest

type FollowCancelRequest struct {
	FollowId int64 `json:"followId" binding:"required"`
}

type FollowCancelResponse

type FollowCancelResponse struct {
	ErrCode uint8  `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
}

type FollowGetContent

type FollowGetContent struct {
	FollowId int64         `json:"followId"`
	UserId   int64         `json:"userId"`
	Name     string        `json:"name"`
	Photo    string        `json:"photo"`
	OrgName  string        `json:"orgName"`
	UserType uint8         `json"userType"`
	Projs    *[]model.Proj `json:"projs,omitempty"`
}

type FollowGetRequest

type FollowGetRequest struct {
	FollowId int64 `json:"followId" binding:"required"`
}

type FollowGetResponse

type FollowGetResponse struct {
	ErrCode uint8             `json:"errCode"`
	ErrMsg  string            `json:"errMsg"`
	Content *FollowGetContent `json:"content,omitempty"`
}

type FollowItemV2

type FollowItemV2 struct {
	FollowId *int64    `json:"followId,omitempty"`
	UserId   int64     `json:"userId"`
	Name     string    `json:"name"`
	Photo    string    `json:"photo"`
	OrgName  string    `json:"orgName"`
	UserType uint8     `json:"userType"`
	Projs    *[]string `json:"projs,omitempty"`
}

type FollowListContent

type FollowListContent struct {
	Follows []FollowItemV2 `json:"follows"`
}

type FollowListDB

type FollowListDB struct {
	FollowId int64
	UserId   int64
	Name     string
	Photo    string
	OrgName  string
	UserType uint8
	ProjId   int64
	ProjSts  uint8
	ProjName string
	Company  string
	Addr     string
	Dim      string
}

type FollowListDBKey

type FollowListDBKey struct {
	FollowId int64
	UserId   int64
	Name     string
	Photo    string
	OrgName  string
	UserType uint8
}

type FollowListRequest

type FollowListRequest struct {
}

type FollowListResponse

type FollowListResponse struct {
	ErrCode           uint8              `json:"errCode"`
	ErrMsg            string             `json:"errMsg"`
	FollowListContent *FollowListContent `json:"content,omitempty"`
}

type FollowResource

type FollowResource struct {
	DB   gorm.DB
	Push *push.BaiduPushClient
}

func (*FollowResource) Add

func (fr *FollowResource) Add(c *gin.Context)

Add follow between users. this function just send a follow message to user who will be followed. and wait for followed user confirm accept or reject follow request. 添加关注 &推送关注消息

func (*FollowResource) Agree

func (fr *FollowResource) Agree(c *gin.Context)

func (*FollowResource) Cancel

func (fr *FollowResource) Cancel(c *gin.Context)

取消关注

func (*FollowResource) Get

func (fr *FollowResource) Get(c *gin.Context)

func (*FollowResource) List

func (fr *FollowResource) List(c *gin.Context)

####################################################### ####################################################### ####################################################### 关注列表

func (FollowResource) Search

func (fr FollowResource) Search(c *gin.Context)

type FollowSearchRequest

type FollowSearchRequest struct {
	UserName string `json:"userName" binding:"required"`
}

type FolowSearchResponse

type FolowSearchResponse struct {
	ErrCode             uint8   `json:"errCode"`
	ErrMsg              string  `json:"errMsg"`
	FollowSearchContent *Follow `json:"content,omitempty"`
}

type Message

type Message struct {
	FaultId     int64      `json:"faultId"`
	Title       string     `json:"title"`
	Sts         uint8      `json:"sts"`
	Level       uint8      `json:"level"`
	CreateDate  *time.Time `json:"createDate"`
	ProjName    string     `json:"projName"`
	ProjCompany string     `json:"projCompany"`
	ReadFlag    uint8      `json:"readFlag"`
}

type MessageDeleteAllResponse

type MessageDeleteAllResponse struct {
	ErrCode uint8  `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
}

type MessageDeleteRequest

type MessageDeleteRequest struct {
	FaultId int64 `json:"faultId" binding:"required"`
}

type MessageDeleteResponse

type MessageDeleteResponse struct {
	ErrCode uint8  `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
}

type MessageListContent

type MessageListContent struct {
	Messages *[]Message `json:"messages"`
}

type MessageListRequest

type MessageListRequest struct {
}

type MessageListResponse

type MessageListResponse struct {
	ErrCode uint8               `json:"errCode"`
	ErrMsg  string              `json:"errMsg"`
	Content *MessageListContent `json:"content,omitempty"`
}

type MessageReadRequest

type MessageReadRequest struct {
	FaultId int64 `json:"faultId" binding:"required"`
}

type MessageReadResponse

type MessageReadResponse struct {
	ErrCode uint8  `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
}

type NotifyFaultRequest

type NotifyFaultRequest struct {
	FaultId int64 `json:"id"`
	ProjId  int64 `json:"projId"`
}

type OrderItem

type OrderItem struct {
	FaultId     int64      `json:"faultId"`
	Desc        *string    `json:"desc"`
	Sts         uint8      `json:"sts"`
	Level       uint8      `json:"level"`
	CreateDate  *time.Time `json:"createDate"`
	ProjName    *string    `json:"projName"`
	ProjCompany *string    `json:"projCompany"`
}

type ProjGetRequest

type ProjGetRequest struct {
	ProjId int64 `json:"projId" binding:"required"`
}

type ProjGetResponse

type ProjGetResponse struct {
	ErrCode        uint8       `json:"errCode"`
	ErrMsg         string      `json:"errMsg"`
	ProjGetContent *model.Proj `json:"content,omitempty"`
}

type ProjItem

type ProjItem struct {
	ProjId      int64  `json:"projId"`
	Name        string `json:"name"`
	Company     string `json:"company"`
	MonitorType string `json:"monitorType"`
	Sts         uint8  `json:"sts"`
}

type ProjListContent

type ProjListContent struct {
	Projs []ProjItem `json:"projs"`
}

type ProjListRequest

type ProjListRequest struct {
	ProjIds *[]int64 `json:"projIds" binding:"exists"`
}

type ProjListResponse

type ProjListResponse struct {
	ErrCode         uint8            `json:"errCode"`
	ErrMsg          string           `json:"errMsg"`
	ProjListContent *ProjListContent `json:"content,omitempty"`
}

type ProjResource

type ProjResource struct {
	DB gorm.DB
}

func (*ProjResource) Get

func (pr *ProjResource) Get(c *gin.Context)

func (*ProjResource) List

func (pr *ProjResource) List(c *gin.Context)

func (*ProjResource) Sts

func (pr *ProjResource) Sts(req ProjStsRequest) error

type ProjStsContent

type ProjStsContent struct {
	ProjId     int64     `json:"projId"`
	Sts        uint8     `json:"sts"`
	CreateDate time.Time `json:"createDate"`
}

type ProjStsRequest

type ProjStsRequest struct {
	UserId     int64
	ProjId     int64
	Sts        uint8
	CreateDate time.Time
}

type PushFaultNotifyRequest

type PushFaultNotifyRequest struct {
	APS     *APS               `json:"aps,omitempty"`
	UserId  int64              `json:"user_id"`
	MsgType uint8              `json:"msg_type"`
	Content FaultNotifyContent `json:"content"`
}

-----------Push Fault Notify

type PushFaultNotifyRequest1

type PushFaultNotifyRequest1 struct {
	APS1 *APS1 `json:"aps,omitempty"`
}

type PushFaultNotifyRequestIOS

type PushFaultNotifyRequestIOS struct {
	APS         *APS   `json:"aps,omitempty"`
	UserId      string `json:"userId"`
	MsgType     string `json:"msgType"`
	FaultId     string `json:"faultId"`
	Title       string `json:"title"`
	Sts         string `json:"sts"`
	Level       string `json:"level"`
	CreateDate  string `json:"createDate"`
	ProjName    string `json:"projName"`
	ProjCompany string `json:"projCompany"`
}

type PushFaultStatRequest

type PushFaultStatRequest struct {
	APS     *APS              `json:"aps,omitempty"`
	UserId  int64             `json:"user_id"`
	MsgType uint8             `json:"msg_type"`
	Content *FaultStatContent `json:"content",omitempty`
}

type PushFaultStsRequest

type PushFaultStsRequest struct {
	APS     *APS             `json:"aps,omitempty"`
	UserId  int64            `json:"user_id"`
	MsgType uint8            `json:"msg_type"`
	Content *FaultStsContent `json:"content",omitempty`
}

------------Push Fault State change

type PushFaultStsRequestIOS

type PushFaultStsRequestIOS struct {
	APS        *APS      `json:"aps,omitempty"`
	UserId     string    `json:"user_id"`
	MsgType    string    `json:"msg_type"`
	FaultId    string    `json:"faultId"`
	Sts        string    `json:"sts"`
	CreateDate time.Time `json:"createDate"`
}

type PushMsgBatchRequest

type PushMsgBatchRequest struct {
	APS     *APS    `json:"aps,omitempty"`
	UserIds []int64 `json:"userIds"`
	MsgType uint8   `json:"msg_type"`
	MsgId   int64   `json:"msg_id"`
}

type PushMsgBatchResponse

type PushMsgBatchResponse struct {
	ErrCode uint8  `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
}

type PushMsgRequest

type PushMsgRequest struct {
	APS     *APS  `json:"aps,omitempty"`
	UserId  int64 `json:"user_id"`
	MsgType uint8 `json:"msg_type"`
	MsgId   int64 `json:"msg_id"`
}

type PushMsgResponse

type PushMsgResponse struct {
	ErrCode uint8  `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
}

type PushProjStsRequest

type PushProjStsRequest struct {
	APS     *APS           `json:"aps,omitempty"`
	UserId  int64          `json:"user_id"`
	MsgType uint8          `json:"msg_type"`
	Content ProjStsContent `json:"content"`
}

type PushRegisterRequest

type PushRegisterRequest struct {
	UserId        int64  `json:"userId" binding:"required" `
	PushChannelId string `json:"push_channel_id" binding:"required"`
	PushAppId     string `json:"push_appid" binding:"required"`
	PushUserId    string `json:"push_user_id" binding:"required"`
}

type PushRegisterResponse

type PushRegisterResponse struct {
	ErrCode uint8  `json:"errCode"`
	ErrMsg  string `json:"errMsg"`
}

type PushResource

type PushResource struct {
	DB gorm.DB
}

func (*PushResource) PushMsgSingle

func (pr *PushResource) PushMsgSingle(c *gin.Context)

func (*PushResource) Register

func (pr *PushResource) Register(c *gin.Context)

Client Push Register. Only when client put baidu push regist information to Server side and then the server can be push message to client.

type RemarkItem

type RemarkItem struct {
	Remark     string     `json:"remark"`
	CreateDate *time.Time `json:"createDate"`
	UserId     int64      `json:"userId"`
	UserName   *string    `json:"userName"`
	PhotoUrl   *string    `json:"photoUrl,omitempty"`
}

type UploadContent

type UploadContent struct {
	Url string `json:"url"`
}

type UploadResponse

type UploadResponse struct {
	ErrCode uint8         `json:"errCode"`
	ErrMsg  string        `json:"errMsg"`
	Content UploadContent `json:"content,omitempty"`
}

type UserCertContent

type UserCertContent struct {
	Id     int64 `json:"id"`
	Status uint8 `json:"userStatus"`
}

type UserCertResponse

type UserCertResponse struct {
	ErrCode uint8            `json:"errCode"`
	ErrMsg  string           `json:"errMsg"`
	Content *UserCertContent `json:"content,omitempty"`
}

type UserChangePwdReq

type UserChangePwdReq struct {
	OldPwd string `json:"oldpwd" binding:"required"`
	NewPwd string `json:"newpwd" binding:"required"`
}

type UserGetContent

type UserGetContent struct {
	Id            int64      `db:"id" json:"id"`
	Name          string     `db:"name" json:"name" `
	Email         string     `db:"email" json:"email,omitempty"`
	Tel           string     `db:"tel" json:"tel"`
	Mobile        string     `db:"mobile" json:"mobile"`
	Sex           uint8      `db:"sex" json:"sex"`
	Class         uint8      `db:"class" json:"class"`
	Status        uint8      `db:"status" json:"userStatus"`
	UserType      uint8      `db:"type" json:"userType"`
	Level         uint8      `db:"level" json:"creditRating"`
	Points        uint8      `db:"points" json:"points"`
	Abilitys      *[]string  `json:"abilitys,omitempty"`
	OrgName       string     `json:"orgName"`
	ProvinceName  string     `json:"provinceName"`
	Photo         string     `json:"photo"`
	LoginPlatform uint8      `json:"-"`
	LoginIp       string     `json:"-"`
	LoginDate     time.Time  `json:"-"`
	LoginFlag     uint8      `json:"-"`
	ValidateDate  time.Time  `json:"-"`
	ExpireDate    time.Time  `json:"-"`
	CreateBy      string     `json:"-"`
	CreateDate    *time.Time `json:"createDate,omitempty"`
	UpdateBy      string     `json:"-"`
	UpdateDate    time.Time  `json:"-"`
	Remarks       string     `json:"-"`
	DelFlag       uint8      `json:"-"`
}

type UserGetRequest

type UserGetRequest struct {
	UserId int64 `json:"userId,omitempty"`
}

type UserGetResponse

type UserGetResponse struct {
	ErrCode uint8           `json:"errCode"`
	ErrMsg  string          `json:"errMsg"`
	Content *UserGetContent `json:"content,omitempty"`
}

* User Information get interface Request URL /user/get

type UserLoginContent

type UserLoginContent struct {
	//	AccessToken string `json:accessToken`
	//	Id          int64  `json:"id"`
	//	Name        string `json:"name" `
	//	Photo       string `json:"photo"`
	//	UserType    uint8  `json:"userType"`
	//	Status      uint8  `json:"userStatus"`
	//	Sex         uint8  `json:"sex"`
	//	Level       uint8  `json:"level"`
	AccessToken  string    `json:"accessToken"`
	Id           int64     `db:"id" json:"id"`
	Name         string    `db:"name" json:"name" `
	Email        string    `db:"email" json:"email,omitempty"`
	Tel          string    `db:"tel" json:"tel"`
	Mobile       string    `db:"mobile" json:"mobile"`
	Sex          uint8     `db:"sex" json:"sex"`
	Class        uint8     `db:"class" json:"class"`
	Status       uint8     `db:"status" json:"userStatus"`
	UserType     uint8     `db:"type" json:"userType"`
	Level        uint8     `db:"level" json:"creditRating"`
	Points       uint8     `db:"points" json:"points"`
	Abilitys     *[]string `json:"abilitys,omitempty"`
	OrgName      string    `json:"orgName"`
	ProvinceName string    `json:"provinceName"`
	Photo        string    `json:"photo"`
	CreateDate   time.Time `json:"createDate,omitempty"`
}

type UserLoginRequest

type UserLoginRequest struct {
	Name      string `json:"name" binding:"required"`
	Passwrord string `json:"pwd" binding:"required"`
}

* User Login interface Request URL /user/login

type UserLoginResponse

type UserLoginResponse struct {
	ErrCode uint8             `json:"errCode"`
	ErrMsg  string            `json:"errMsg"`
	Content *UserLoginContent `json:"content,omitempty"`
}

type UserModContent

type UserModContent struct {
	Id     int64 `json:"id"`
	Status uint8 `json:"userStatus"`
}

type UserModRequest

type UserModRequest struct {
	Name     string    `json:"name"`
	Status   uint8     `json:"userStatus"`
	UserType *uint8    `json:"userType",omitempty`
	Photo    string    `json:"photo"`
	Sex      uint8     `json:"sex"`
	Abilitys *[]string `json:"abilitys"`
}

* User Modify interface request struct Request URL /user/mod

type UserModResponse

type UserModResponse struct {
	ErrCode uint8           `json:"errCode"`
	ErrMsg  string          `json:"errMsg"`
	Content *UserModContent `json:"content,omitempty"`
}

type UserRegisterContent

type UserRegisterContent struct {
	Id     int64 `json:"id"`
	Status uint8 `json:"userStatus"`
}

type UserRegisterResponse

type UserRegisterResponse struct {
	ErrCode uint8                `json:"errCode"`
	ErrMsg  string               `json:"errMsg"`
	Content *UserRegisterContent `json:"content,omitempty"`
}

type UserResource

type UserResource struct {
	DB gorm.DB
}

func (*UserResource) Cert

func (ur *UserResource) Cert(c *gin.Context)

user realname certify.

func (*UserResource) ChangePwd

func (ur *UserResource) ChangePwd(c *gin.Context)

Change Password

func (*UserResource) FeedBack

func (ur *UserResource) FeedBack(c *gin.Context)

feedback

func (*UserResource) FindPwdByTel

func (ur *UserResource) FindPwdByTel(c *gin.Context)

Find Password by user's telphone.

func (*UserResource) Get

func (ur *UserResource) Get(c *gin.Context)

Get user information

func (*UserResource) Login

func (ur *UserResource) Login(c *gin.Context)

login

func (*UserResource) Logout

func (ur *UserResource) Logout(c *gin.Context)

logout

func (*UserResource) Mod

func (ur *UserResource) Mod(c *gin.Context)

modify user information

func (*UserResource) Register

func (ur *UserResource) Register(c *gin.Context)

User register

func (*UserResource) Vc

func (ur *UserResource) Vc(c *gin.Context)

type UserVCContent

type UserVCContent struct {
	VCcode string `json:"vccode"`
}

type UserVCRequest

type UserVCRequest struct {
	Imei string `json:"imei`
	Tel  string `json:"tel"`
}

* User SMS message validate interface Request URL /user/vc

type UserVCResponse

type UserVCResponse struct {
	ErrCode uint8         `json:"errCode"`
	ErrMsg  string        `json:"errMsg"`
	Content UserVCContent `json:"content,omitempty"`
}

Jump to

Keyboard shortcuts

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