ucenter.go 1.6 KB
package protocol

const (
	ModuleOportunity = "opportunity"
	ModuleQuestion   = "question"
)

const (
	MethodLogin      = "/auth/login"
	MethodGetUser    = "/users/"
	MethodPutUser    = "/users/"
	MethodUserExists = "/users/isExist"
)

/*UCenterLogin */
type UCenterLoginRequest struct {
	Phone     string `json:"phone"`
	PassWord  string `json:"password"`
	Code      string `json:"code"`
	GrantType string `json:"grantType" valid:"Required"`
	//ClientId  string `json:"clientId" valid:"Required"`
}
type UCenterLoginResponse struct {
	Uid    int64               `json:"uid"` //统一用户中心用户编号,作为登录凭证
	Module []*ModulePermission `json:"module"`
}

//模块权限  (机会)opportunity  (问题)question
type ModulePermission struct {
	Name  string              `json:"name"` //模块名称  子菜单名称  `
	Menus []*ModulePermission `json:"-"`    //子模块权限
}

/*获取用户信息 UCenterGetUser */
type UCenterGetUserRequest struct {
}
type UCenterGetUserResponse struct {
	Id              int64  `json:"id"`
	Phone           string `json:"phone"`
	NickName        string `json:"nickname"`
	Avatar          string `json:"avatar"`
	Token           string `json:"token"`
	Accid           string `json:"accid"`
	CustomerAccount string `json:"customerAccount"`
}

/*修改用户信息  UCenterPutUser */
type UCenterPutUserRequest struct {
	Phone    string `json:"phone,omitempty"`
	PassWord string `json:"password,omitempty"`
	NickName string `json:"nickname,omitempty"`
	Avatar   string `json:"avatar,omitempty"`
}
type UCenterPutUserResponse struct {
}