public_struct.go 3.9 KB
Newer Older
W
wenxu12345 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
package base_info

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type UserInfo struct {
	UserID      string `json:"userID" binding:"required,min=1,max=64"`
	Nickname    string `json:"nickname" binding:"required,min=1,max=64"`
	FaceUrl     string `json:"faceUrl" binding:"omitempty,max=1024"`
	Gender      int32  `json:"gender" binding:"omitempty,oneof=0 1 2"`
	PhoneNumber string `json:"phoneNumber" binding:"omitempty,max=32"`
	Birth       string `json:"birth" binding:"omitempty,max=16"`
	Email       string `json:"email" binding:"omitempty,max=64"`
	Ex          string `json:"ex" binding:"omitempty,max=1024"`
}

func SetErrCodeMsg(c *gin.Context, status int) *CommResp {
	resp := CommResp{ErrCode: int32(status), ErrMsg: http.StatusText(status)}
	c.JSON(status, resp)
	return &resp
}

W
wenxu12345 已提交
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
//
//type GroupInfo struct {
//	GroupID       string `json:"groupID"`
//	GroupName     string `json:"groupName"`
//	Notification  string `json:"notification"`
//	Introduction  string `json:"introduction"`
//	FaceUrl       string `json:"faceUrl"`
//	OperationID   string `json:"operationID"`
//	OwnerUserID   string `json:"ownerUserID"`
//	CreateTime    int64  `json:"createTime"`
//	MemberCount   uint32 `json:"memberCount"`
//	Ex            string `json:"ex"`
//	Status        int32  `json:"status"`
//	CreatorUserID string `json:"creatorUserID"`
//	GroupType     int32  `json:"groupType"`
//}
//
//type GroupMemberFullInfo struct {
//	GroupID        string `json:"groupID"`
//	UserID         string `json:"userID"`
//	RoleLevel      int32  `json:"roleLevel"`
//	JoinTime       uint64 `json:"joinTime"`
//	Nickname       string `json:"nickname"`
//	FaceUrl        string `json:"faceUrl"`
//	FriendRemark   string `json:"friendRemark"`
//	AppMangerLevel int32  `json:"appMangerLevel"`
//	JoinSource     int32  `json:"joinSource"`
//	OperatorUserID string `json:"operatorUserID"`
//	Ex             string `json:"ex"`
//}
//
//type PublicUserInfo struct {
//	UserID   string `json:"userID"`
//	Nickname string `json:"nickname"`
//	FaceUrl  string `json:"faceUrl"`
//	Gender   int32  `json:"gender"`
//}
//
//type UserInfo struct {
//	UserID   string `json:"userID"`
//	Nickname string `json:"nickname"`
//	FaceUrl  string `json:"faceUrl"`
//	Gender   int32  `json:"gender"`
//	Mobile   string `json:"mobile"`
//	Birth    string `json:"birth"`
//	Email    string `json:"email"`
//	Ex       string `json:"ex"`
//}
//
//type FriendInfo struct {
//	OwnerUserID    string   `json:"ownerUserID"`
//	Remark         string   `json:"remark"`
//	CreateTime     int64    `json:"createTime"`
//	FriendUser     UserInfo `json:"friendUser"`
//	AddSource      int32    `json:"addSource"`
//	OperatorUserID string   `json:"operatorUserID"`
//	Ex             string   `json:"ex"`
//}
//
//type BlackInfo struct {
//	OwnerUserID    string         `json:"ownerUserID"`
//	CreateTime     int64          `json:"createTime"`
//	BlackUser      PublicUserInfo `json:"friendUser"`
//	AddSource      int32          `json:"addSource"`
//	OperatorUserID string         `json:"operatorUserID"`
//	Ex             string         `json:"ex"`
//}
//
//type GroupRequest struct {
//	UserID       string `json:"userID"`
//	GroupID      string `json:"groupID"`
//	HandleResult string `json:"handleResult"`
//	ReqMsg       string `json:"reqMsg"`
//	HandleMsg    string `json:"handleMsg"`
//	ReqTime      int64  `json:"reqTime"`
//	HandleUserID string `json:"handleUserID"`
//	HandleTime   int64  `json:"handleTime"`
//	Ex           string `json:"ex"`
//}
//
//type FriendRequest struct {
//	FromUserID    string `json:"fromUserID"`
//	ToUserID      string `json:"toUserID"`
//	HandleResult  int32  `json:"handleResult"`
//	ReqMessage    string `json:"reqMessage"`
//	CreateTime    int64  `json:"createTime"`
//	HandlerUserID string `json:"handlerUserID"`
//	HandleMsg     string `json:"handleMsg"`
//	HandleTime    int64  `json:"handleTime"`
//	Ex            string `json:"ex"`
//}
//
//
//