datadef.go 8.49 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427
package logic

//微信url定义
const (
	URL_WEIXINMSG_CHECK = "https://api.weixin.qq.com/wxa/msg_sec_check"
	URL_WEIXINGETACCESS_TOKEN = "https://api.weixin.qq.com/cgi-bin/token"
)

//登录类型枚举
const (
	LOGIN_TYPE_TOURIST					= 1		//游客登录
	LOGIN_TYPE_ACCOUNT       = 2  //账号密码登录
	LOGIN_TYPE_WECHAT       = 3  //微信登录

)

type UserLoginReq struct {
	Channel_id int `json:"channel_id"`
	Invite_type int `json:"invite_type"`
	Invite_res_id int `json:"invite_res_id"`
	User_invite_uid int `json:"user_invite_uid"`
	Scene int `json:"scene"`
	RefAppId int `json:"refAppId"`
	Code string `json:"code"`
	Token string `json:"token"`
	Logintype int `json:"logintype"`
	Useraccount string `json:"useraccount"`
	Userpwd string `json:"userpwd"`
	Version string `json:"version"`

}

type UserBaseData struct {
	User_id int `json:"user_id"`
	User_gender int `json:"user_gender"`
	User_nickname string `json:"user_nickname"`
	User_openid string `json:"user_openid"`
	User_avatar_url string `json:"user_avatar_url"`
	User_city string `json:"user_city"`
	User_token string `json:"user_token"`
}

type UserExtData struct {
	User_id int `json:"user_id"`
	Hot int `json:"hot"`
	Coin int64 `json:"coin"`
	LoveExp int `json:"loveExp"`
	Bean int `json:"bean"`
	ShopNum int `json:"shopNum"`
	Lv int `json:"lv"`
	Exp int `json:"exp"`
	User_invite_uid int `json:"user_invite_uid"`
	User_reg_time int `json:"user_reg_time"`
	User_channel int `json:"user_channel"`
	User_is_black int `json:"user_is_black"`
	User_scene int `json:"user_scene"`
	Reg_time int `json:"reg_time"`
	Invite_uid int `json:"invite_uid"`
}

type UserLoginData struct {
	Dasedata UserBaseData `json:"UserBaseData"`
	Extdata UserExtData `json:"user_ext_data"`
}

type UserLoginResult struct {
	Code int `json:"code"`
	Data UserLoginData `json:"data"`
}



type UserLoginResp struct {
	Status    string    `json:"status"`
	Result UserLoginResult `json:"result"`

}

type SaveUserDataReq struct{
	Token string `json:"token"`
	Hot int `json:"hot"`
	Coin int64 `json:"coin"`
	Loveexp int `json:"loveexp"`
	Bean int `json:"bean"`
	Shopnum int `json:"shopnum"`
}

type SaveUserDataResp struct {
	Status    string    `json:"status"`
	Result UserLoginResult `json:"result"`
}

type CommonResult struct {
	Code int `json:"code"`
	Data string `json:"data"`
}

type SaveDataReq struct{
	Token string `json:"token"`
	Field string `json:"field"`
	Value string `json:"value"`
}

type SaveDataResp struct {
	Status    string    `json:"status"`
	Result CommonResult `json:"result"`
}

type GetDataDesc struct {
	Base_data string `json:"base_data"`
}

type GetDataResult struct {
	Code int `json:"code"`
	Data GetDataDesc `json:"data"`
}

type GetDataReq struct{
	Token string `json:"token"`
	Field string `json:"field"`
}

type GetDataResp struct {
	Status    string    `json:"status"`
	Result GetDataResult `json:"result"`
}

type TextCheckReq struct{
	Token string `json:"token"`
	Text string `json:"text"`
}

type TextCheckResp struct {
	Status    string    `json:"status"`
	Result CommonResult `json:"result"`
}

type MsgCheckDesc struct {
	Content string `json:"content"`
}

type MsgCheckResp struct {
	Errcode string `json:"errcode"`
	Errmsg string `json:"errmsg"`
}

type GetAccessTokenResp struct {
	Access_token string `json:"access_token"`
	Expires_in string `json:"expires_in"`
}


type CreateTeamReq struct{
	Token string `json:"token"`
	Name string `json:"name"`
	Is_open int `json:"is_open"`
	Limit int `json:"limit"`
}

//队伍列表人员id
type TeamMemInfo struct {
	MemList	[]int
}

//玩家投资信心
type TeamDevoteInfo struct {
	UserId 	int	`json:"userid"`
	Type 	int	`json:"type"`
	Assets 	int	`json:"assets"`
}

//玩家buff
type TeamBuffInfo struct {
	BeginTime	int
	EndTime 	int
}

//
type TeamAllBuff struct {
	Type 	int
	BuffInfo []TeamBuffInfo
}

//队伍建筑信息
type TeamBuildingInfo struct {
	Devote []TeamDevoteInfo
	Buff []TeamAllBuff
}

type CreateTeamInfo struct {
	Id int `json:"id"`
	Name string `json:"name"`
	Is_open int `json:"is_open"`
	Num int `json:"num"`
	Assets int `json:"assets"`
	Least int `json:"least"`
	Captain_id int `json:"captain_id"`
	Creator_id int `json:"creator_id"`
	Status int `json:"status"`
	Create_time int `json:"create_time"`
	Update_time int `json:"update_time"`
}

//队伍信息
type TeamInfo struct {
	BaseInfo CreateTeamInfo
	MemInfo TeamMemInfo
	BInfo TeamBuildingInfo
}

type CreateTeamDesc struct {
	Team_data CreateTeamInfo `json:"team_data"`
}

type CreateTeamData struct {
	Code int `json:"code"`
	Data CreateTeamDesc `json:"data"`
}

type CreateTeamResp struct {
	Status    string    `json:"status"`
	Result CreateTeamData `json:"result"`
}


type JoinTeamReq struct{
	Token string `json:"token"`
	Team_id int `json:"team_id"`
}

type JoinTeamResp struct {
	Status    string    `json:"status"`
	Result CommonResult `json:"result"`
}


type JoinTeamByInviteReq struct{
	Token string `json:"token"`
	Inviter_id int `json:"inviter_id"`
}

type JoinTeamByInviteResp struct {
	Status    string    `json:"status"`
	Result CommonResult `json:"result"`
}

type QuitTeamReq struct{
	Token string `json:"token"`
	User_id int `json:"user_id"`
	Type int `json:"type"`
}

type QuitTeamResp struct {
	Status    string    `json:"status"`
	Result CommonResult `json:"result"`
}

type UpdateTeamBuildReq struct{
	Token string `json:"token"`
	Build_type int `json:"build_type"`
	Assets int `json:"assets"`
	Muti int `json:"muti"`
}

type QuitTeamDesc struct {
	Build_list []TeamDevoteInfo `json:"build_list"`
}

type QuitTeamResult struct {
	Code int `json:"code"`
	Data QuitTeamDesc `json:"data"`
}

type UpdateTeamBuildResp struct {
	Status    string    `json:"status"`
	Result QuitTeamResult `json:"result"`
}



type AddTeamBuffReq struct{
	Token string `json:"token"`
	Build_type int `json:"build_type"`
	Muti int `json:"muti"`
}

type BuffTimeInfo struct {
	Buff_begin_time int `json:"buff_begin_time"`
	Buff_end_time int `json:"buff_end_time"`
}

type AddTeamBuffSpec struct {
	Build_type int `json:"build_type"`
	Buff_time  []BuffTimeInfo `json:"buff_time"`
}

type AddTeamBuffDesc struct {
	Build_list []AddTeamBuffSpec `json:"build_list"`
}

type AddTeamBuffResult struct {
	Code int `json:"code"`
	Data AddTeamBuffDesc `json:"data"`
}

type AddTeamBuffResp struct {
	Status    string    `json:"status"`
	Result AddTeamBuffResult `json:"result"`
}

type GetTeamBuffReq struct{
	Token string `json:"token"`
}

type GetTeamBuffResp struct {
	Status    string    `json:"status"`
	Result AddTeamBuffResult `json:"result"`
}

type GetTeamDataReq struct{
	Token string `json:"token"`
}

type GetTeamDataTeamUserList struct {
	Uuid int `json:"uuid"`
}

type GetTeamDataDesc struct {
	Team_data CreateTeamInfo `json:"team_data"`
	Team_user_list []GetTeamDataTeamUserList `json:"team_user_list"`
	Build_list QuitTeamDesc `json:"build_list"`
}

type GetTeamDataResult struct {
	Code int `json:"code"`
	Data GetTeamDataDesc `json:"data"`
}

type GetTeamDataResp struct {
	Status    string    `json:"status"`
	Result GetTeamDataResult `json:"result"`
}

type GetDataByUserIdReq struct{
	Token string `json:"token"`
	Field string `json:"field"`
	User_id int `json:"user_id"`
}

type GetDataByUserIdDesc struct {
	Base_data string `json:"base_data"`
	User_base_data UserBaseData `json:"user_base_data"`
	Extdata UserExtData `json:"user_ext_data"`
}

type GetDataByUserIdResult struct {
	Code int `json:"code"`
	Data GetDataByUserIdDesc `json:"data"`
}

type GetDataByUserIdResp struct {
	Status    string    `json:"status"`
	Result GetDataByUserIdResult `json:"result"`
}


type GetTeamListReq struct{
	Token string `json:"token"`
	Store_num int `json:"store_num"`
	Page int `json:"page"`
}

type GetTeamListDesc struct {
	Items []int `json:"items"`
	Count int `json:"count"`
}

type GetTeamListResult struct {
	Code int `json:"code"`
	Data GetTeamListDesc `json:"data"`
}


type GetTeamListResp struct {
	Status    string    `json:"status"`
	Result GetTeamListResult `json:"result"`
}

type SearchTeamReq struct{
	Token string `json:"token"`
	Name string `json:"name"`
	Store_num int `json:"store_num"`
	Page int `json:"page"`
}




type SearchTeamResp struct {
	Status    string    `json:"status"`
	Result GetTeamListResult `json:"result"`
}


//**********************************************************************************************************


//玩家数据
type UserData struct {
	Userid 			int			//玩家id
	Hot				int
	Coin 			int64		//金币
	Loevexp			int
	Bean			int 		//咖啡豆
	Shopnum			int			//店铺数量
	Lv				int
	Exp 			int
	UserInviteId	int
	Userregtime			int
	Channel			int
	Isblack			int
	Scene			int
	Regtime			int
	InviteUid		int

}