123456789101112131415161718192021222324252627282930 |
- package models
- type Role int
- const (
- RoleMerchant = 1
- RoleAdmin = 2
- )
- //func (r Role) SecretKey() string {
- // switch r {
- // case RoleMerchant:
- // return viper.GetString("token_key.merchant")
- // case RoleAdmin:
- // return viper.GetString("token_key.admin")
- // }
- // return ""
- //}
- type LoginRequest struct {
- Phone string `json:"phone"`
- Password string `json:"password"`
- }
- type LoginReply struct {
- UserId string `json:"user_id"`
- Phone string `json:"phone"`
- Token string `json:"token"`
- Role int `json:"role"`
- }
|