datadef.go 17.4 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 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770
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 RedisTeamInfo struct {
	Team_id int `json:"team_id"`
	User_id int `json:"user_id"`
}

type WechatLoginReq 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"`
	Code            string `json:"code"`
	Signature       string `json:"signature"`
	Iv              string `json:"iv"`
	Raw_data        string `json:"raw_data"`
	Encrypted_data  string `json:"encrypted_data"`
	Token           string `json:"token"`
	Version         string `json:"version"`
}

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"`
	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 QueryInviteReq struct {
	Uuid int `json:"uuid"`
}

type QueryInviteData struct {
	Uuid      int    `json:"uuid"`
	Nickname  string `json:"nickname"`
	Headurl   string `json:"headurl"`
	Isfetched int    `json:"isfetched"`
}

type QueryInviteDesc struct {
	Invite_data []QueryInviteData `json:"invite_data"`
}

type QueryInviteResult struct {
	Code int             `json:"code"`
	Data QueryInviteDesc `json:"data"`
}

type QueryInviteResp struct {
	Status string            `json:"status"`
	Result QueryInviteResult `json:"result"`
}

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

type QueryBrifeMessageData struct {
	Uuid     int    `json:"uuid"`
	Ctype    int    `json:"ctype"`
	Isnew    int    `json:"isnew"`
	Headurl  string `json:"headurl"`
	Nickname string `json:"nickname"`
}

type QueryBrifeMessageDesc struct {
	Emojinfo    []int                   `json:"emojinfo"`
	Channelinfo []QueryBrifeMessageData `json:"channelinfo"`
}

type QueryBrifeMessageResult struct {
	Code int                   `json:"code"`
	Data QueryBrifeMessageDesc `json:"data"`
}

type QueryBrifeMessageResp struct {
	Status string                  `json:"status"`
	Result QueryBrifeMessageResult `json:"result"`
}

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

type QueryNewMessageDesc struct {
	Isnew int `json:"isnew"`
}

type QueryNewMessageResult struct {
	Code int                 `json:"code"`
	Data QueryNewMessageDesc `json:"data"`
}

type QueryNewMessageResp struct {
	Status string                `json:"status"`
	Result QueryNewMessageResult `json:"result"`
}

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

//邀请打工数据结构
type InviteWorkDesc struct {
	Uuid       int    `json:"uuid"`       //打工者ID
	InviteTime int    `json:"invitetime"` //开始打工时间
	Nickname   string `json:"nickname"`   //昵称
	HeadUrl    string `json:"headurl"`    //头像

}

type InviteWorkOffDesc struct {
	Uuid       int `json:"uuid"`       //打工者ID
	InviteTime int `json:"invitetime"` //打工者ID

}

type InviteWorksDesc struct {
	Invite_data []InviteWorkDesc    `json:"invite_data"`
	Offlinelist []InviteWorkOffDesc `json:"offlinelist"`
}

type InviteWorkResult struct {
	Code int             `json:"code"`
	Data InviteWorksDesc `json:"data"`
}

type InviteWorkResp struct {
	Status string           `json:"status"`
	Result InviteWorkResult `json:"result"`
}

type InitIndexDesc struct {
	Env_enum       int    `json:"env_enum"`
	Lbase64        int    `json:"lbase64"`
	Res_url        string `json:"res_url"`
	Version_config string `json:"version_config"`
}

type InitIndexResult struct {
	Code int           `json:"code"`
	Data InitIndexDesc `json:"data"`
}

type InitIndexResp struct {
	Status string          `json:"status"`
	Result InitIndexResult `json:"result"`
}

type SaveDataBackupReq struct {
	Uuid  int    `json:"uuid"`
	Value string `json:"value"`
}

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

type FetchInviteReq struct {
	Selfuuid int `json:"selfuuid"`
	Fuuid    int `json:"fuuid"`
}

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

type EnterInviteReq struct {
	Selfuuid   int `json:"selfuuid"`
	Inviteuuid int `json:"inviteuuid"`
	Invitetype int `json:"invitetype"`
}

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

type RegeisterReq struct {
	Account  string `json:"account"`
	Password string `json:"password"`
}

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

type AccounLoginReq struct {
	Account  string `json:"account"`
	Password string `json:"password"`
}

type AccounLoginResp 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 {
	Uuid  int    `json:"uuid"`
	Field string `json:"field"`
}

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

type GetDataSaveDesc struct {
	Data_uid   string `json:"data_uid"`
	Data_value string `json:"data_value"`
}

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 FriendInfo struct {
	Uuid   int `json:"uuid"`
	Status int `json:"status"`
}

type FriendList struct {
	Friends []FriendInfo `json:"friends"`
}

type ApplyInfo struct {
	Uuid       int `json:"uuid"`
	Apply_time int `json:"apply_time"`
}
type ApplyList struct {
	Apply_info []ApplyInfo `json:"apply_info"`
}

type ApproveList struct {
	Approve_info []ApplyInfo `json:"approve_info"`
}

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

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

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

type GetFriendListDesc struct {
	Friend_list []FriendInfo `json:"friend_list"`
}

type GetFriendListResult struct {
	Code int               `json:"code"`
	Data GetFriendListDesc `json:"data"`
}

type GetFriendListResp struct {
	Status string              `json:"status"`
	Result GetFriendListResult `json:"result"`
}

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

type GetAuditListDesc struct {
	Approve_list []ApplyInfo `json:"approve_list"`
}

type GetAuditListResult struct {
	Code int              `json:"code"`
	Data GetAuditListDesc `json:"data"`
}

type GetAuditListResp struct {
	Status string             `json:"status"`
	Result GetAuditListResult `json:"result"`
}

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

type GetRecommendListInfo struct {
	Userid     int    `json:"userid"`
	Nickname   string `json:"nickname"`
	Avatar_url string `json:"avatar_url"`
	Gender     int    `json:"gender"`
	City       string `json:"city"`
	Hot        int    `json:"hot"`
	Coin       int64  `json:"coin"`
	Love_exp   int    `json:"love_exp"`
	Bean       int    `json:"bean"`
	Shop_num   int    `json:"shop_num"`
	Cat_num    int    `json:"cat_num"`
	Lv         int    `json:"lv"`
	Exp        int    `json:"exp"`
	Reg_time   int    `json:"reg_time"`
}

type GetRecommendListDesc struct {
	Recommend_list []GetRecommendListInfo `json:"recommend_list"`
}

type GetRecommendListResult struct {
	Code int                  `json:"code"`
	Data GetRecommendListDesc `json:"data"`
}

type GetRecommendListResp struct {
	Status string                 `json:"status"`
	Result GetRecommendListResult `json:"result"`
}

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

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

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

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

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

type QueryPlayerDataDesc struct {
	Player_data GetRecommendListInfo `json:"player_data"`
}

type QueryPlayerDataResult struct {
	Code int                 `json:"code"`
	Data QueryPlayerDataDesc `json:"data"`
}

type QueryPlayerDataResp struct {
	Status string                `json:"status"`
	Result QueryPlayerDataResult `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
	LoginTime    int
	LoginDay     int
}

//---------------------------------------------------------------------------------------------------------------------
//聊天相关
type ChatInfoDesc struct {
	Uuid     int    `json:"uuid"`
	Headurl  string `json:"headurl"`
	Nickname string `json:"nickname"`
	Sex      int    `json:"sex"` //1男0女
	ChatTime int    `json:"chattime"`
	Message  string `json:"message"`
}

//聊天单个页签信息
type ChannelInfo struct {
	Uuid     int    `json:"uuid"`
	Ctype    int    `json:"ctype"`
	Isnew    int    `json:"isnew"` //是否有新聊天
	Headurl  string `json:"headurl"`
	Nickname string `json:"nickname"`
}

type EmojunlockInfo struct {
	Emojinfo []int `json:"emojinfo"`
}