Documentation ¶
Index ¶
- Constants
- func FileExists(name string) bool
- func IsEmptyBody(c *gin.Context) bool
- func SendVC(tel, vccode string) (string, bool)
- type APS
- type APS1
- type CommonResource
- type CommonResponse
- type DataResource
- type Empty
- type FaultGetContent
- type FaultGetContentV2
- type FaultGetRequest
- type FaultGetResponse
- type FaultItem
- type FaultItemV2
- type FaultListContent
- type FaultListRequest
- type FaultListResponse
- type FaultNotifyContent
- type FaultOrderListContent
- type FaultOrderListRequest
- type FaultOrderListResponse
- type FaultRemarkAddContent
- type FaultRemarkAddRequest
- type FaultRemarkAddResponse
- type FaultRemarkGetContent
- type FaultRemarkGetRequest
- type FaultRemarkGetResponse
- type FaultRemarkListContent
- type FaultRemarkListRequest
- type FaultRemarkListResponse
- type FaultResource
- func (fr *FaultResource) Get(c *gin.Context)
- func (fr *FaultResource) List(c *gin.Context)
- func (fr *FaultResource) MessageDelete(c *gin.Context)
- func (fr *FaultResource) MessageDeleteAll(c *gin.Context)
- func (fr *FaultResource) MessageList(c *gin.Context)
- func (fr *FaultResource) MessageRead(c *gin.Context)
- func (fr *FaultResource) NotifyFault(c *gin.Context)
- func (fr *FaultResource) OrderList(c *gin.Context)
- func (fr *FaultResource) RemarkAdd(c *gin.Context)
- func (fr *FaultResource) RemarkGet(c *gin.Context)
- func (fr *FaultResource) RemarkList(c *gin.Context)
- func (fr *FaultResource) Stat(c *gin.Context)
- func (fr *FaultResource) Sts(c *gin.Context)
- type FaultStatContent
- type FaultStatResponse
- type FaultStsContent
- type FaultStsNotify
- type FaultStsRequest
- type FeedBackRequest
- type FindPwdByTelRequest
- type Follow
- type FollowAddContent
- type FollowAddRequest
- type FollowAddResponse
- type FollowAgreeRequest
- type FollowAgreeResponse
- type FollowCancelRequest
- type FollowCancelResponse
- type FollowGetContent
- type FollowGetRequest
- type FollowGetResponse
- type FollowItemV2
- type FollowListContent
- type FollowListDB
- type FollowListDBKey
- type FollowListRequest
- type FollowListResponse
- type FollowResource
- type FollowSearchRequest
- type FolowSearchResponse
- type Message
- type MessageDeleteAllResponse
- type MessageDeleteRequest
- type MessageDeleteResponse
- type MessageListContent
- type MessageListRequest
- type MessageListResponse
- type MessageReadRequest
- type MessageReadResponse
- type NotifyFaultRequest
- type OrderItem
- type ProjGetRequest
- type ProjGetResponse
- type ProjItem
- type ProjListContent
- type ProjListRequest
- type ProjListResponse
- type ProjResource
- type ProjStsContent
- type ProjStsRequest
- type PushFaultNotifyRequest
- type PushFaultNotifyRequest1
- type PushFaultNotifyRequestIOS
- type PushFaultStatRequest
- type PushFaultStsRequest
- type PushFaultStsRequestIOS
- type PushMsgBatchRequest
- type PushMsgBatchResponse
- type PushMsgRequest
- type PushMsgResponse
- type PushProjStsRequest
- type PushRegisterRequest
- type PushRegisterResponse
- type PushResource
- type RemarkItem
- type UploadContent
- type UploadResponse
- type UserCertContent
- type UserCertResponse
- type UserChangePwdReq
- type UserGetContent
- type UserGetRequest
- type UserGetResponse
- type UserLoginContent
- type UserLoginRequest
- type UserLoginResponse
- type UserModContent
- type UserModRequest
- type UserModResponse
- type UserRegisterContent
- type UserRegisterResponse
- type UserResource
- func (ur *UserResource) Cert(c *gin.Context)
- func (ur *UserResource) ChangePwd(c *gin.Context)
- func (ur *UserResource) FeedBack(c *gin.Context)
- func (ur *UserResource) FindPwdByTel(c *gin.Context)
- func (ur *UserResource) Get(c *gin.Context)
- func (ur *UserResource) Login(c *gin.Context)
- func (ur *UserResource) Logout(c *gin.Context)
- func (ur *UserResource) Mod(c *gin.Context)
- func (ur *UserResource) Register(c *gin.Context)
- func (ur *UserResource) Vc(c *gin.Context)
- type UserVCContent
- type UserVCRequest
- type UserVCResponse
Constants ¶
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) )
const ( ERRCODE_SUCCESS = 0 ERRMSG_SUCCESS = "success" )
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
FileExists reports whether the named file or directory exists.
func IsEmptyBody ¶
Types ¶
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 DataResource ¶
type DataResource struct {
DataPath string
}
func (*DataResource) Upload ¶
func (d *DataResource) Upload(c *gin.Context)
type FaultGetContent ¶
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 FaultItemV2 ¶
type FaultListContent ¶
type FaultListContent struct {
Faults []FaultItemV2 `json:"faults,omitempty"`
}
type FaultListRequest ¶
type FaultListResponse ¶
type FaultListResponse struct { ErrCode uint8 `json:"errCode"` ErrMsg string `json:"errMsg"` Content *FaultListContent `json:"content,omitempty"` }
type FaultNotifyContent ¶
type FaultOrderListContent ¶
type FaultOrderListContent struct {
Faults *[]OrderItem `json:"faults"`
}
type FaultOrderListRequest ¶
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 FaultRemarkAddResponse ¶
type FaultRemarkGetContent ¶
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 ¶
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) 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 FaultStatResponse ¶
type FaultStatResponse struct { ErrCode uint8 `json:"errCode"` ErrMsg string `json:"errMsg"` Content *FaultStatContent `json:"content,omitempty"` }
type FaultStsContent ¶
type FaultStsNotify ¶
type FaultStsRequest ¶
type FeedBackRequest ¶
type FeedBackRequest struct {
Content string `json:"content" binding:"required"`
}
type FindPwdByTelRequest ¶
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 FollowAgreeResponse ¶
type FollowCancelRequest ¶
type FollowCancelRequest struct {
FollowId int64 `json:"followId" binding:"required"`
}
type FollowCancelResponse ¶
type FollowGetContent ¶
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 FollowListContent ¶
type FollowListContent struct {
Follows []FollowItemV2 `json:"follows"`
}
type FollowListDB ¶
type FollowListDBKey ¶
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) 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 MessageDeleteRequest ¶
type MessageDeleteRequest struct {
FaultId int64 `json:"faultId" binding:"required"`
}
type MessageDeleteResponse ¶
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 NotifyFaultRequest ¶
type ProjGetRequest ¶
type ProjGetRequest struct {
ProjId int64 `json:"projId" binding:"required"`
}
type ProjGetResponse ¶
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 ¶
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 ProjStsRequest ¶
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 PushMsgBatchRequest ¶
type PushMsgBatchResponse ¶
type PushMsgRequest ¶
type PushMsgResponse ¶
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 PushRegisterResponse ¶
type PushResource ¶
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 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 UserCertResponse ¶
type UserCertResponse struct { ErrCode uint8 `json:"errCode"` ErrMsg string `json:"errMsg"` Content *UserCertContent `json:"content,omitempty"` }
type UserChangePwdReq ¶
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 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 UserRegisterResponse ¶
type UserRegisterResponse struct { ErrCode uint8 `json:"errCode"` ErrMsg string `json:"errMsg"` Content *UserRegisterContent `json:"content,omitempty"` }
type UserResource ¶
func (*UserResource) FindPwdByTel ¶
func (ur *UserResource) FindPwdByTel(c *gin.Context)
Find Password by user's telphone.
func (*UserResource) Vc ¶
func (ur *UserResource) Vc(c *gin.Context)
type UserVCContent ¶
type UserVCContent struct {
VCcode string `json:"vccode"`
}
type UserVCRequest ¶
* 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"` }