...
|
...
|
@@ -18,6 +18,10 @@ type RequesLogin struct { |
|
|
Phone string `json:"phone"`
|
|
|
}
|
|
|
|
|
|
var (
|
|
|
_ IUCenterParam = RequesLogin{}
|
|
|
)
|
|
|
|
|
|
//Format 实现IUCenterParam接口
|
|
|
func (r RequesLogin) Format() []byte {
|
|
|
var v []byte
|
...
|
...
|
@@ -47,10 +51,10 @@ type ResponseLogin struct { |
|
|
Data struct {
|
|
|
Id int64 `json:"id"`
|
|
|
Phone string `json:"phone"`
|
|
|
NickName string `json:"nickname"` //昵称
|
|
|
Avatar string `json:"avatar"` //头像
|
|
|
Imtoken string `json:"imtoken"` //网易云imtoken
|
|
|
Accid int64 `json:"accid"`
|
|
|
NickName string `json:"nickname"` //昵称
|
|
|
Avatar string `json:"avatar"` //头像
|
|
|
Imtoken string `json:"imtoken"` //网易云imtoken
|
|
|
Accid int64 `json:"accid"` //网易云id
|
|
|
CustomerAccount int64 `json:"customerAccount"` //客服id
|
|
|
} `json:"data"`
|
|
|
}
|
...
|
...
|
@@ -61,9 +65,13 @@ type RequestAddUser struct { |
|
|
RegIm int8 `json:"regIm"`
|
|
|
Nickname string `json:"nickname"`
|
|
|
Avatar string `json:"avatar"`
|
|
|
Password string `json:"password"`
|
|
|
// Password string `json:"password"`
|
|
|
}
|
|
|
|
|
|
var (
|
|
|
_ IUCenterParam = RequestAddUser{}
|
|
|
)
|
|
|
|
|
|
//Format 实现IUCenterParam接口
|
|
|
func (r RequestAddUser) Format() []byte {
|
|
|
var v []byte
|
...
|
...
|
@@ -73,14 +81,11 @@ func (r RequestAddUser) Format() []byte { |
|
|
|
|
|
//Format 实现IUCenterParam接口
|
|
|
func (r RequestAddUser) GetPath() (string, string) {
|
|
|
return "/users", "POST"
|
|
|
return "/users/save", "POST"
|
|
|
}
|
|
|
|
|
|
//Format 实现IUCenterParam接口
|
|
|
func (r RequestAddUser) Valid() error {
|
|
|
if len(r.Password) == 0 {
|
|
|
return errors.New("len(r.Password) == 0")
|
|
|
}
|
|
|
if len(r.Phone) == 0 {
|
|
|
return errors.New("len(r.Phone == 0")
|
|
|
}
|
...
|
...
|
@@ -100,43 +105,15 @@ type ResponseAddUser struct { |
|
|
} `json:"data"`
|
|
|
}
|
|
|
|
|
|
// type RequestCheckCompany struct {
|
|
|
// CompanyId int64 `json:"company_id"`
|
|
|
// }
|
|
|
|
|
|
// //Format 实现IUCenterParam接口
|
|
|
// func (r RequestCheckCompany) Format() []byte {
|
|
|
// return nil
|
|
|
// }
|
|
|
|
|
|
// //Format 实现IUCenterParam接口
|
|
|
// func (r RequestCheckCompany) GetPath() (string, string) {
|
|
|
// return fmt.Sprintf("/company/%d", r.CompanyId), "GET"
|
|
|
// }
|
|
|
|
|
|
// //Format 实现IUCenterParam接口
|
|
|
// func (r RequestCheckCompany) Valid() error {
|
|
|
// if r.CompanyId == 0 {
|
|
|
// return errors.New("r.CompanyId == 0")
|
|
|
// }
|
|
|
// return nil
|
|
|
// }
|
|
|
|
|
|
// type ResponseCheckCompany struct {
|
|
|
// CommResponse
|
|
|
// Data struct {
|
|
|
// CompanyId int64 `json:"id"` //公司的id
|
|
|
// CompanyName string `json:"name"` //公司的名称
|
|
|
// AdminAccount string `json:"admin_account"` //主管账号
|
|
|
// AdminName string `json:"admin_name"` //主管名称
|
|
|
// } `json:"data"`
|
|
|
// }
|
|
|
|
|
|
//发送验证码短信
|
|
|
type RequestSmsCodeSend struct {
|
|
|
Phone string `json:"phone"`
|
|
|
}
|
|
|
|
|
|
var (
|
|
|
_ IUCenterParam = RequestSmsCodeSend{}
|
|
|
)
|
|
|
|
|
|
func (r RequestSmsCodeSend) Format() []byte {
|
|
|
var bt []byte
|
|
|
bt, _ = json.Marshal(r)
|
...
|
...
|
@@ -155,6 +132,22 @@ type RequestLoginSms struct { |
|
|
GrantType string `json:"grantType"` //登陆方式(signInCaptcha验证码)
|
|
|
}
|
|
|
|
|
|
var (
|
|
|
_ IUCenterParam = RequestLoginSms{}
|
|
|
)
|
|
|
|
|
|
//Format 实现IUCenterParam接口
|
|
|
func (r RequestLoginSms) Format() []byte {
|
|
|
var v []byte
|
|
|
v, _ = json.Marshal(r)
|
|
|
return v
|
|
|
}
|
|
|
|
|
|
//GetPath 实现IUCenterParam接口
|
|
|
func (r RequestLoginSms) GetPath() (string, string) {
|
|
|
return "/auth/loginAggregate", "POST"
|
|
|
}
|
|
|
|
|
|
//ResponseLoginSms 短信验证码登录 响应
|
|
|
type ResponseLoginSms struct {
|
|
|
CommResponse
|
...
|
...
|
@@ -168,6 +161,6 @@ type LoginSmsData struct { |
|
|
Image struct {
|
|
|
Path string `json:"path"`
|
|
|
} `json:"image"`
|
|
|
ImToken string `json:"imtoken"`
|
|
|
Imtoken string `json:"imToken"`
|
|
|
CsAccountID int64 `json:"csAccountID"`
|
|
|
} |
...
|
...
|
|