Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"face.go",
"login_log.go",
"pwd.go",
"rpc.go",
],
importpath = "go-common/app/service/main/passport/model",
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,13 @@
package model
// FaceApply face record.
type FaceApply struct {
ID int64 `json:"-"`
Mid int64 `json:"mid"`
OldFace string `json:"old_face"`
NewFace string `json:"new_face"`
ApplyTime int64 `json:"apply_time"`
Status string `json:"status"`
Operator string `json:"operator"`
ModifyTime string `json:"modify_time"`
}

View File

@@ -0,0 +1,43 @@
package model
import (
"fmt"
)
// LoginLog login log.
type LoginLog struct {
Mid int64 `json:"mid"`
Timestamp int64 `json:"timestamp"`
LoginIP int64 `json:"loginip"`
Type int64 `json:"type"`
Server string `json:"server"`
}
// LoginLogResp login log.
type LoginLogResp struct {
Mid int64 `json:"mid"`
Timestamp int64 `json:"timestamp"`
LoginIP string `json:"loginip"`
Type int64 `json:"type"`
Server string `json:"server"`
}
// Format format login log to login log resp.
func Format(l *LoginLog) *LoginLogResp {
if l == nil {
return nil
}
return &LoginLogResp{
Mid: l.Mid,
Timestamp: l.Timestamp,
LoginIP: InetNtoA(l.LoginIP),
Type: l.Type,
Server: l.Server,
}
}
// InetNtoA .
func InetNtoA(ip int64) string {
return fmt.Sprintf("%d.%d.%d.%d",
byte(ip>>24), byte(ip>>16), byte(ip>>8), byte(ip))
}

View File

@@ -0,0 +1,13 @@
package model
// HistoryPwdCheckParam history pwd check param
type HistoryPwdCheckParam struct {
Mid int64 `form:"mid"`
Pwd string `form:"pwd"`
}
// HistoryPwd history pwd
type HistoryPwd struct {
OldPwd string
OldSalt string
}

View File

@@ -0,0 +1,7 @@
package model
// ArgLoginLogs arg for RPC.LoginLogs.
type ArgLoginLogs struct {
Mid int64
Limit int
}