Commit 47a84b63 by zhangjie

1. token的KEY改为配置文件可配,以便区分测试环境和生产环境

2. 硬件TCP连接服务剥离出去(未测试) 3. 重新整理GRPC文件名及包名
parent ebd6fd46
......@@ -4,50 +4,39 @@
<option name="autoReloadType" value="ALL" />
</component>
<component name="ChangeListManager">
<list default="true" id="d8ed78cd-bda7-467e-9bd3-d1cee57e3c79" name="变更" comment="1. 通联用户ID的前缀修改到配置文件,以分离生产和测试环境用户">
<change afterPath="$PROJECT_DIR$/api/router/noSwagger.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/router/useSwagger.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/buildTestLinux.bat" afterDir="false" />
<change afterPath="$PROJECT_DIR$/logger/logger_release.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/releaseLinux.bat" afterDir="false" />
<change afterPath="$PROJECT_DIR$/z9_output_release/customerServer.new" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/dc_golang_server_1.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dc_golang_server_1.iml" afterDir="false" />
<list default="true" id="d8ed78cd-bda7-467e-9bd3-d1cee57e3c79" name="变更" comment="1. TCP没分离的版本">
<change afterPath="$PROJECT_DIR$/grpc_client/GrpcFromDeviceConn/clientApp.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/grpc_client/GrpcFromDeviceConn/grpcClient.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/grpc_server/Grpc2Phone20TcpConn/ReceivePhone20TcpCallback.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/my_grpc/grpc_deviceConnServer/deviceConnServer.pb.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/my_grpc/grpc_deviceConnServer/deviceConnServer.proto" afterDir="false" />
<change afterPath="$PROJECT_DIR$/my_grpc/grpc_deviceConnServer/deviceConnServer_grpc.pb.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/KNimLiDNiC.txt" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/api/api_we/api_we_card_operate/CardBind.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/api_we/api_we_card_operate/CardBind.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/api_we/api_we_card_operate/Qr2CardID.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/api_we/api_we_card_operate/Qr2CardID.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/api_we/api_we_login_we_info/Login.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/api_we/api_we_login_we_info/Login.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/api_we/api_we_login_we_info/LoginTest.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/api_we/api_we_login_we_info/LoginTest.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/api_we/api_we_login_we_info/WechatUserBindWePhone.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/api_we/api_we_login_we_info/WechatUserBindWePhone.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/api_we/api_we_phone_card/AddFamilyNum.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/api_we/api_we_phone_card/AddFamilyNum.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/api_we/api_we_phone_card/AddFamilyNumTest.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/api_we/api_we_phone_card/AddFamilyNumTest.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/api_we/api_we_phone_card/DeleteFamilyNum.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/api_we/api_we_phone_card/DeleteFamilyNum.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/api_we/api_we_phone_card/PutFamilyNickName.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/api_we/api_we_phone_card/PutFamilyNickName.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/router/router.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/router/router.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/buildlinux.bat" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/api/api_server_ops/GetSystemRunPara.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/api_server_ops/GetSystemRunPara.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/jeffwt.go" beforeDir="false" afterPath="$PROJECT_DIR$/api/jeffwt.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config.ini" beforeDir="false" afterPath="$PROJECT_DIR$/config.ini" afterDir="false" />
<change beforePath="$PROJECT_DIR$/customerServer.new" beforeDir="false" afterPath="$PROJECT_DIR$/z8_output_test/customerServer.new" afterDir="false" />
<change beforePath="$PROJECT_DIR$/data_db_cache/cache/cmap_siminfo.go" beforeDir="false" afterPath="$PROJECT_DIR$/data_db_cache/cache/cmap_siminfo.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/data_db_cache/dbcurd/db.go" beforeDir="false" afterPath="$PROJECT_DIR$/data_db_cache/dbcurd/db.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/data_db_cache/dbcurd/u_sim_info.go" beforeDir="false" afterPath="$PROJECT_DIR$/data_db_cache/dbcurd/u_sim_info.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/data_db_cache/model/CacheModel.go" beforeDir="false" afterPath="$PROJECT_DIR$/data_db_cache/model/CacheModel.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dev_product/dc_longtcp_hex_protocol.go" beforeDir="false" afterPath="$PROJECT_DIR$/dev_product/dc_longtcp_hex_protocol.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dev_product/dcphone20/dc_phone20.go" beforeDir="false" afterPath="$PROJECT_DIR$/dev_product/dcphone20/dc_phone20.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dev_product/dcphone20/dc_phone20_http_server.go" beforeDir="false" afterPath="$PROJECT_DIR$/dev_product/dcphone20/dc_phone20_http_server.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dev_product/dcphone20/dc_phone20_tcp.go" beforeDir="false" afterPath="$PROJECT_DIR$/dev_product/dcphone20/dc_phone20_tcp.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dev_product/jeff_hex_server.go" beforeDir="false" afterPath="$PROJECT_DIR$/dev_product/zzz_jeff_hex_server.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs/docs.go" beforeDir="false" afterPath="$PROJECT_DIR$/docs/docs.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs/swagger.json" beforeDir="false" afterPath="$PROJECT_DIR$/docs/swagger.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs/swagger.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/docs/swagger.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/go.mod" beforeDir="false" afterPath="$PROJECT_DIR$/go.mod" afterDir="false" />
<change beforePath="$PROJECT_DIR$/go.sum" beforeDir="false" afterPath="$PROJECT_DIR$/go.sum" afterDir="false" />
<change beforePath="$PROJECT_DIR$/grpc_server/uSimInfo.go" beforeDir="false" afterPath="$PROJECT_DIR$/grpc_server/uSimInfo.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/log/gInfo.log" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/log/sInfo.log" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/logger/logger.go" beforeDir="false" afterPath="$PROJECT_DIR$/logger/logger_debug.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/grpc_server/area.go" beforeDir="false" afterPath="$PROJECT_DIR$/grpc_server/Grpc2Admin/area.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/grpc_server/areaService.go" beforeDir="false" afterPath="$PROJECT_DIR$/grpc_server/Grpc2Admin/areaService.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/grpc_server/devPhone20.go" beforeDir="false" afterPath="$PROJECT_DIR$/grpc_server/Grpc2Admin/devPhone20.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/grpc_server/phonePayList.go" beforeDir="false" afterPath="$PROJECT_DIR$/grpc_server/Grpc2Admin/phonePayList.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/grpc_server/uSimInfo.go" beforeDir="false" afterPath="$PROJECT_DIR$/grpc_server/Grpc2Admin/uSimInfo.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/grpc_server/uWeCustomer.go" beforeDir="false" afterPath="$PROJECT_DIR$/grpc_server/Grpc2Admin/uWeCustomer.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.go" beforeDir="false" afterPath="$PROJECT_DIR$/main.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/my_grpc/grpc_area_map/areaMap.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/my_grpc/grpc_area_map/areaMap.pb.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/my_grpc/grpc_area_map/areaMap.proto" beforeDir="false" afterPath="$PROJECT_DIR$/my_grpc/grpc_area_map/areaMap.proto" afterDir="false" />
<change beforePath="$PROJECT_DIR$/my_grpc/grpc_area_map/areaMap_grpc.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/my_grpc/grpc_area_map/areaMap_grpc.pb.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/run.bat" beforeDir="false" afterPath="$PROJECT_DIR$/run.bat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/thirdapi/chinamobile/onelink.go" beforeDir="false" afterPath="$PROJECT_DIR$/thirdapi/chinamobile/onelink.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/thirdapi/tencent/wechatLogin.go" beforeDir="false" afterPath="$PROJECT_DIR$/thirdapi/tencent/wechatLoginAndGetPhone.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/my_grpc/build.bat" beforeDir="false" afterPath="$PROJECT_DIR$/my_grpc/build.bat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/my_grpc/grpc_area_map/areaMap.pb.go" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/my_grpc/grpc_area_map/areaMap.proto" beforeDir="false" afterPath="$PROJECT_DIR$/my_grpc/grpc_k122Server/k122Server.proto" afterDir="false" />
<change beforePath="$PROJECT_DIR$/my_grpc/grpc_area_map/areaMap_grpc.pb.go" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/util/setting/setting.go" beforeDir="false" afterPath="$PROJECT_DIR$/util/setting/setting.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/z8_output_test/customerServer.new" beforeDir="false" afterPath="$PROJECT_DIR$/z8_output_test/customerServer.new" afterDir="false" />
<change beforePath="$PROJECT_DIR$/z9_output_release/customerServer.new" beforeDir="false" afterPath="$PROJECT_DIR$/z9_output_release/customerServer.new" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -84,14 +73,16 @@
<property name="go.import.settings.migrated" value="true" />
<property name="go.modules.go.list.on.any.changes.was.set" value="true" />
<property name="go.sdk.automatically.set" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../dc_golang_server1_admin" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="settings.editor.selected.configurable" value="com.goide.configuration.GoProjectSettingsConfigurable" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="E:\Go\project\myproject\dc_golang_server_1\my_grpc" />
<recent name="E:\Go\project\myproject\dc_golang_server_1\logger" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="E:\Go\project\myproject\dc_golang_server_1\grpc_server\k122Server" />
<recent name="E:\Go\project\myproject\dc_golang_server_1\util" />
</key>
</component>
......@@ -128,7 +119,8 @@
<component name="VcsManagerConfiguration">
<MESSAGE value="1. 支付修改为通联支付" />
<MESSAGE value="1. 通联用户ID的前缀修改到配置文件,以分离生产和测试环境用户" />
<option name="LAST_COMMIT_MESSAGE" value="1. 通联用户ID的前缀修改到配置文件,以分离生产和测试环境用户" />
<MESSAGE value="1. TCP没分离的版本" />
<option name="LAST_COMMIT_MESSAGE" value="1. TCP没分离的版本" />
</component>
<component name="VgoProject">
<integration-enabled>true</integration-enabled>
......
......@@ -2,7 +2,6 @@ package api_server_ops
import (
"dc_golang_server_1/api"
"dc_golang_server_1/dev_product/dcphone20"
"dc_golang_server_1/logger"
"dc_golang_server_1/util"
"github.com/gin-gonic/gin"
......@@ -11,7 +10,7 @@ import (
type apiGetSystemRunParaStruct struct {
util.Server
PhoneTcpSocketNo int32 `json:"phoneSocketNo"` // 电话机Socket连接数
// PhoneTcpSocketNo int32 `json:"phoneSocketNo"` // 电话机Socket连接数
HttpReqNo int32 `json:"httpReqNo"` // 当前http请求数
}
......@@ -33,7 +32,7 @@ func GetSystemRunPara(c *gin.Context) {
Ram: util.GetRamInfo(),
Disk: util.GetDiskInfo(),
},
dcphone20.TCP.ConnSocketCount,
// dcphone20.TCP.ConnSocketCount,
logger.GinHttpReqNum,
},
})
......@@ -43,4 +42,4 @@ func GetSystemRunPara(c *gin.Context) {
// todo 暂停硬件链接并关闭所有的socket 同时这个接口可开启正常链接
// todo 停止服务,通过1个channel到主函数,如果停止,等所有web响应结束了停止
\ No newline at end of file
// todo 停止服务,通过1个channel到主函数,如果停止,等所有web响应结束了停止
......@@ -3,14 +3,13 @@ package api
import (
"dc_golang_server_1/data_db_cache/cache"
"dc_golang_server_1/util"
"dc_golang_server_1/util/setting"
"github.com/gin-gonic/gin"
"math/rand"
"net/http"
"time"
)
const jeffWTKey = "jeffWT@666%b;'~+"
//const jeffWTTable = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
const tokenClearLen = 20
......@@ -58,7 +57,7 @@ func CreateToken(creatTime int64, userID uint32, userType uint8, expireTime uint
clear[18] = ^(clear[18] + random - 15)
clear[19] = ^clear[19] - random
return util.EncryptBytesToBase64URL(clear, jeffWTKey)
return util.EncryptBytesToBase64URL(clear, setting.TokenKEY)
}
func DecryptToken(token string) (clearStruct TokenResult) {
......@@ -67,7 +66,7 @@ func DecryptToken(token string) (clearStruct TokenResult) {
clearStruct.CheckResult = ErrorTokenExist
return
}
clear, err := util.DecryptBase64URLToBytes(token, jeffWTKey)
clear, err := util.DecryptBase64URLToBytes(token, setting.TokenKEY)
if err != nil {
// todo logger 有人在非法请求
clearStruct.CheckResult = ErrorTokenWrong
......
[token]
KEY = `jeffWT@666%b;'~+`
[grpc_server]
Grpc2AdminListenPort = :7010
Grpc2TcpConnListenPort = :7011
[grpc_client]
GrpcFromDeviceConnServerIpPort = 127.0.0.1:7020
[allin_pay]
#测试 K12B 正式 K12B-
AdminHead = K12B
......
package dev_product
import (
"context"
"dc_golang_server_1/data_db_cache/dbcurd"
"dc_golang_server_1/grpc_client/GrpcFromDeviceConn"
"dc_golang_server_1/logger"
deviceConnServer "dc_golang_server_1/my_grpc/grpc_deviceConnServer"
"dc_golang_server_1/util"
"encoding/hex"
"errors"
"go.uber.org/zap"
"net"
"strconv"
"time"
)
......@@ -16,7 +19,6 @@ import (
//}
type DCLongTCPHex struct {
TCPLongServer
password string
iv string
devType uint8
......@@ -71,25 +73,19 @@ func /*(d *DCLongTCPHex)*/ insertDevHexCommandRecordRW(data *HexData, ciphertext
})
}
func (d *DCLongTCPHex) receiveResponse(conn *net.TCPConn, data []byte, nowConnDevID uint32) uint32 {
func (d *DCLongTCPHex) ReceiveResponse(data []byte) (uint32, []byte, error) {
c, err := util.DecryptBase64ToBytes(data, d.password, d.iv)
if err != nil {
if nowConnDevID != 0 {
dbcurd.InsertDevCommandErr(nowConnDevID, string(data), "Decrypt err")
}
return 0
return 0, nil, err
}
if util.CheckCRC(c) == false {
dbcurd.InsertDevCommandErr(nowConnDevID, string(data), "CheckCRC err")
return 0
return 0, nil, errors.New("CheckCRC err")
}
cLen := len(c)
if cLen < 12 {
dbcurd.InsertDevCommandErr(nowConnDevID, string(data), "cLen<12")
return 0
return 0, nil, errors.New("cLen<12")
} else if int(c[9])+12 != cLen {
dbcurd.InsertDevCommandErr(nowConnDevID, string(data), "cLen!=c[9]+12")
return 0
return 0, nil, errors.New("cLen!=c[9]+12")
}
var rData HexData
......@@ -97,15 +93,13 @@ func (d *DCLongTCPHex) receiveResponse(conn *net.TCPConn, data []byte, nowConnDe
// 时间有效性判断
nowTimeUtc := uint32(time.Now().Unix())
if nowTimeUtc > rData.TimeUtc+300 || rData.TimeUtc > nowTimeUtc+300 {
dbcurd.InsertDevCommandErr(nowConnDevID, string(data), "utc err:"+strconv.FormatUint(uint64(rData.TimeUtc), 10))
return 0
if nowTimeUtc > rData.TimeUtc+300 || rData.TimeUtc > nowTimeUtc+300 { // 允许5分钟以内的
return rData.DevID, nil, errors.New("utc err")
}
// 设备类型判断
if c[4] != d.devType {
dbcurd.InsertDevCommandErr(nowConnDevID, string(data), "devType error")
return 0
return rData.DevID, nil, errors.New("devType error")
}
rData.DevID = uint32(c[4])<<24 | uint32(c[5])<<16 | uint32(c[6])<<8 | uint32(c[7])
......@@ -126,73 +120,44 @@ func (d *DCLongTCPHex) receiveResponse(conn *net.TCPConn, data []byte, nowConnDe
//if sendFlag {time.Sleep(20*time.Millisecond)} //这句话是为了多帧发送间隔20MS,可以不加试试
if _, err = conn.Write(sendStr); err != nil {
//logger.Log.Debug("conn.Write(sendStr) error", // 刚收到发来的,现在居然发不回去了
// zap.String("Src", "TCP-SERVER-receive"),
// zap.Uint32("DevID", rData.DevID),
// zap.String("RData", string(data)),
// zap.String("SendStr", string(sendStr)),
// zap.String("Conn", conn.RemoteAddr().String()))
//if nowConnDevID == 0 { //刚才没有ID的在这里记
// model.InsertDevCommandErr(rData.DevID,string(data),"A error")
//}
return 0
}
//if _, err = conn.Write(sendStr); err != nil {
// //logger.Log.Debug("conn.Write(sendStr) error", // 刚收到发来的,现在居然发不回去了
// // zap.String("Src", "TCP-SERVER-receive"),
// // zap.Uint32("DevID", rData.DevID),
// // zap.String("RData", string(data)),
// // zap.String("SendStr", string(sendStr)),
// // zap.String("Conn", conn.RemoteAddr().String()))
// //if nowConnDevID == 0 { //刚才没有ID的在这里记
// // model.InsertDevCommandErr(rData.DevID,string(data),"A error")
// //}
// return 0
//}
//if rData.CtrlCode != 0xc1 && rData.CtrlCode != 0xbf { //心跳不记 开机注册不记
insertDevHexCommandRecordRW(&recData, string(data), 0, &rData, string(sendStr), 1) //0接收 1回复 2主动下发
//}
return rData.DevID, sendStr, nil
} else {
insertDevHexCommandRecord(&recData, string(data), 0)
}
return rData.DevID //解密成功且CRC校验成功,设备类型一致,解析长度正确,则为合法设备
return rData.DevID, nil, nil //解密成功且CRC校验成功,设备类型一致,解析长度正确,则为合法设备
}
func (d *DCLongTCPHex) TCPSend(data *HexData) bool {
//d.ConnectMapRWMutex.RLock()
//c,ok := d.ConnectMap[data.DevID]// conn,ok := d.ConnectMap.Load(data.DevID)
//d.ConnectMapRWMutex.RUnlock()
if conn, ok := d.ConnectMap.Load(data.DevID); ok {
if c, ok := conn.(*net.TCPConn); ok { // 类型断言
sendStr := d.packageSendData(data)
sendStr[0] = '['
sendStr[len(sendStr)-1] = ']'
if _, err := c.Write(sendStr); err != nil {
//d.ConnectMapRWMutex.Lock()
//delete(d.ConnectMap,data.DevID)// d.ConnectMap.Delete(data.DevID)
//d.ConnectMapRWMutex.Unlock()
/*errC*/
_ = c.Close()
d.ConnectMap.Delete(data.DevID)
/*if errC != nil {
model.DevConnectRecord(data.DevID,false,'W')
} else {
model.DevConnectRecord(data.DevID,false,'w')
}*/
//logger.Log.Debug("conn.Write(sendStr) error", //
// zap.String("Src", "TCP-SERVER-TCPSend"),
// zap.Uint32("DevID", data.DevID),
// zap.Error(err),
// zap.String("SendStr", string(sendStr)),
// zap.String("Conn", c.RemoteAddr().String()),
// zap.String("State", "offline"))
return false
}
insertDevHexCommandRecord(data, string(sendStr), 2) //0接收 1回复 2主动下发
return true
} else {
// ntodo logger map里面存的内容居然类型不对
d.ConnectMap.Delete(data.DevID)
logger.Log.Error("conn.(*net.TCPConn) != ok", //
zap.String("Src", "TCP-SERVER-TCPSend"),
zap.Uint32("DevID", data.DevID),
zap.String("Conn", c.RemoteAddr().String()),
zap.String("State", "offline"))
}
sendStr := d.packageSendData(data)
sendStr[0] = '['
sendStr[len(sendStr)-1] = ']'
res, err := GrpcFromDeviceConn.Client.SendMsgToDevice(context.Background(), &deviceConnServer.SendMsgToDeviceReq{
DevID: data.DevID,
Data: nil,
})
if err != nil { // grpc 请求错误
logger.Log.Warn("GrpcFromDeviceConn.Client.SendMsgToDevice err", zap.Uint32("devID", data.DevID), zap.Reflect("data", data), zap.String("sendStr", string(sendStr)))
return false
}
return false
return res.Res
}
func (d *DCLongTCPHex) InitNewDCLongTCPHex(password string, iv string, devType uint8, f func(data *HexData)) {
......@@ -200,10 +165,13 @@ func (d *DCLongTCPHex) InitNewDCLongTCPHex(password string, iv string, devType u
d.iv = iv
d.devType = devType
d.protocolAnalysis = f
d.TCPReceive = d.receiveResponse
// d.ConnectMap = make(map[uint32]*net.TCPConn)
}
//func (d *DCLongTCPHex) GetSocketConnNum(){ // 这里不提供,放到后台管理端去提供
//
//}
// 组装并加密数据
func (d *DCLongTCPHex) packageSendData(sData *HexData) []byte {
hexBuf := make([]byte, sData.Length+12)
......
package dcphone20
import (
config2 "dc_golang_server_1/util/setting"
"dc_golang_server_1/grpc_client/GrpcFromDeviceConn"
"dc_golang_server_1/grpc_server/Grpc2Phone20TcpConn"
myGRPC "dc_golang_server_1/my_grpc/grpc_k122Server"
"google.golang.org/grpc"
"net"
)
var TCP DCPhone20
func NewDCPhone20() {
// var DcPhone20TCP DCPhone20
TCP.NewDCPhone20("DCRYM-2018-pswd.", "I can't tell YOU", 0x5B) // setting
TCP.TCPStart(config2.TcpLongPort)
go func() { // todo 加下 recover
GrpcFromDeviceConn.Init()
var tcp DCPhone20
tcp.NewDCPhone20("DCRYM-2018-pswd.", "I can't tell YOU", 0x5B) // setting
l, err := net.Listen("tcp", ":7011")
if err != nil {
panic(err)
}
s := grpc.NewServer()
myGRPC.RegisterGrpc2TcpConnServer(s, &Grpc2Phone20TcpConn.ToTcpConnServer{
ReceiveResponse: tcp.ReceiveResponse,
})
err = s.Serve(l)
if err != nil {
panic(err)
}
}()
}
......@@ -9,18 +9,17 @@ import (
"encoding/json"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"net"
"net/http"
"strconv"
"time"
)
func (dev *DCPhone20) NewDCPhone20API(router *gin.RouterGroup) {
router.GET("online/list", dev.getOnlineList) //查设备是否在线
router.GET("online/num", dev.getOnlineTotal) //查在线设备总数量
router.GET("online/all", dev.getOnlineAll) //查询所有在线设备列表
router.DELETE("online/", dev.delOnlineClose) //批量强制关闭设备连接
//router.GET("online/list", dev.getOnlineList) //查设备是否在线
//router.GET("online/num", dev.getOnlineTotal) //查在线设备总数量
//router.GET("online/all", dev.getOnlineAll) //查询所有在线设备列表
//
//router.DELETE("online/", dev.delOnlineClose) //批量强制关闭设备连接
router.GET("para/:paraName", dev.getDevPara) //读取某些设备某个参数
router.POST("para/:paraName", dev.setDevPara) //设置某些设备某个参数
......@@ -39,147 +38,147 @@ type resGetOnlineList struct {
DevID map[uint32]bool `json:"devID"`
}
// @Tags phone20
// @Summary 查设备是否在线[complete]
// @Description 根据设备ID,查询是否在线
// @Accept json
// @Produce json
// @Param ids body reqIDs true "入参"
// @Success 0 {object} resGetOnlineList "出参"
// @Router /phone20/online/list [GET]
// @Security ApiKeyAuth
func (dev *DCPhone20) getOnlineList(c *gin.Context) {
var dataIn reqIDs
if err := c.ShouldBindJSON(&dataIn); err != nil {
logger.Log.Error("c.ShouldBindJSON(&dataIn)",
zap.String("Src", "getOnlineList"),
zap.Error(err))
c.JSON(http.StatusOK, gin.H{
"code": api.ErrorReqParaFormat,
"message": api.CodeMsg[api.ErrorReqParaFormat],
})
return
}
var dataOut resGetOnlineList
dataOut.DevID = make(map[uint32]bool)
for _, id := range dataIn.DevID {
if _, ok := dev.ConnectMap.Load(id); ok {
dataOut.DevID[id] = true
dataOut.Count++
} else {
dataOut.DevID[id] = false
}
}
c.JSON(http.StatusOK, gin.H{
"code": api.Success,
"data": dataOut,
})
}
//// @Tags phone20
//// @Summary 查设备是否在线[complete]
//// @Description 根据设备ID,查询是否在线
//// @Accept json
//// @Produce json
//// @Param ids body reqIDs true "入参"
//// @Success 0 {object} resGetOnlineList "出参"
//// @Router /phone20/online/list [GET]
//// @Security ApiKeyAuth
//func (dev *DCPhone20) getOnlineList(c *gin.Context) {
// var dataIn reqIDs
// if err := c.ShouldBindJSON(&dataIn); err != nil {
// logger.Log.Error("c.ShouldBindJSON(&dataIn)",
// zap.String("Src", "getOnlineList"),
// zap.Error(err))
// c.JSON(http.StatusOK, gin.H{
// "code": api.ErrorReqParaFormat,
// "message": api.CodeMsg[api.ErrorReqParaFormat],
// })
// return
// }
//
// var dataOut resGetOnlineList
// dataOut.DevID = make(map[uint32]bool)
// for _, id := range dataIn.DevID {
// if _, ok := dev.ConnectMap.Load(id); ok {
// dataOut.DevID[id] = true
// dataOut.Count++
// } else {
// dataOut.DevID[id] = false
// }
// }
// c.JSON(http.StatusOK, gin.H{
// "code": api.Success,
// "data": dataOut,
// })
//}
type resGetOnlineTotal struct {
Count int `json:"count"`
Socket int32 `json:"socket"`
}
// @Tags phone20
// @Summary 查在线设备总数量[complete]
// @Description 查在线设备总数量
// @Produce json
// @Success 0 {object} resGetOnlineTotal "出参"
// @Router /phone20/online/num [GET]
// @Security ApiKeyAuth
func (dev *DCPhone20) getOnlineTotal(c *gin.Context) {
var dataOut resGetOnlineTotal
dev.ConnectMap.Range(func(_, _ interface{}) bool {
dataOut.Count++
return true
})
dataOut.Socket = dev.ConnSocketCount
//type resGetOnlineTotal struct {
// Count int `json:"count"`
// Socket int32 `json:"socket"`
//}
//// @Tags phone20
//// @Summary 查在线设备总数量[complete]
//// @Description 查在线设备总数量
//// @Produce json
//// @Success 0 {object} resGetOnlineTotal "出参"
//// @Router /phone20/online/num [GET]
//// @Security ApiKeyAuth
//func (dev *DCPhone20) getOnlineTotal(c *gin.Context) {
// var dataOut resGetOnlineTotal
// dev.ConnectMap.Range(func(_, _ interface{}) bool {
// dataOut.Count++
// return true
// })
// dataOut.Socket = dev.ConnSocketCount
//
// c.JSON(http.StatusOK, gin.H{
// "code": api.Success,
// "data": dataOut,
// })
//}
c.JSON(http.StatusOK, gin.H{
"code": api.Success,
"data": dataOut,
})
}
//type resGetOnlineAll struct {
// Count int `json:"count"`
// DevID []uint32 `json:"devID"`
// Socket int32 `json:"socket"`
//}
//// @Tags phone20
//// @Summary 查整个在线设备列表[complete]
//// @Description 查整个在线设备列表
//// @Produce json
//// @Success 0 {object} resGetOnlineAll "出参"
//// @Router /phone20/online/all [GET]
//// @Security ApiKeyAuth
//func (dev *DCPhone20) getOnlineAll(c *gin.Context) {
// var dataOut resGetOnlineAll
// //dataOut.DevID = make([]uint32,0,5000)
// dev.ConnectMap.Range(func(k, _ interface{}) bool {
// if d, ok := k.(uint32); ok { // 类型断言
// dataOut.DevID = append(dataOut.DevID, d) //strconv.FormatUint(uint64(d),16))
// dataOut.Count++
// } else {
// dev.ConnectMap.Delete(k)
// }
// return true
// })
// dataOut.Socket = dev.ConnSocketCount
//
// c.JSON(http.StatusOK, gin.H{
// "code": api.Success,
// "data": dataOut,
// })
//}
type resGetOnlineAll struct {
Count int `json:"count"`
DevID []uint32 `json:"devID"`
Socket int32 `json:"socket"`
}
// @Tags phone20
// @Summary 查整个在线设备列表[complete]
// @Description 查整个在线设备列表
// @Produce json
// @Success 0 {object} resGetOnlineAll "出参"
// @Router /phone20/online/all [GET]
// @Security ApiKeyAuth
func (dev *DCPhone20) getOnlineAll(c *gin.Context) {
var dataOut resGetOnlineAll
//dataOut.DevID = make([]uint32,0,5000)
dev.ConnectMap.Range(func(k, _ interface{}) bool {
if d, ok := k.(uint32); ok { // 类型断言
dataOut.DevID = append(dataOut.DevID, d) //strconv.FormatUint(uint64(d),16))
dataOut.Count++
} else {
dev.ConnectMap.Delete(k)
}
return true
})
dataOut.Socket = dev.ConnSocketCount
c.JSON(http.StatusOK, gin.H{
"code": api.Success,
"data": dataOut,
})
}
// @Tags phone20
// @Summary 主动关闭设备链接[complete]
// @Description 主动关闭设备链接
// @Accept json
// @Produce json
// @Param ids body reqIDs true "入参"
// @Success 0 {object} resGetOnlineList "出参"
// @Router /phone20/online [DELETE]
// @Security ApiKeyAuth
func (dev *DCPhone20) delOnlineClose(c *gin.Context) {
type st struct {
DevID []uint32 `json:"devId"`
}
var data st
if err := c.ShouldBindJSON(&data); err != nil {
logger.Log.Error("c.ShouldBindJSON(&data)",
zap.String("Src", "delOnlineClose"),
zap.Error(err))
c.JSON(http.StatusOK, gin.H{
"code": api.ErrorReqParaFormat,
"message": api.CodeMsg[api.ErrorReqParaFormat],
})
return
}
var dataOut resGetOnlineList
dataOut.DevID = make(map[uint32]bool)
for _, id := range data.DevID {
if conn, ok := dev.ConnectMap.Load(id); ok {
if c, ok := conn.(*net.TCPConn); ok { // 类型断言
_ = c.Close()
} /*else { // 类型断言失败
}*/
dev.ConnectMap.Delete(id)
dataOut.Count++
dataOut.DevID[id] = true
} else {
dataOut.DevID[id] = false
}
}
c.JSON(http.StatusOK, gin.H{
"code": api.Success,
"data": dataOut,
})
}
//// @Tags phone20
//// @Summary 主动关闭设备链接[complete]
//// @Description 主动关闭设备链接
//// @Accept json
//// @Produce json
//// @Param ids body reqIDs true "入参"
//// @Success 0 {object} resGetOnlineList "出参"
//// @Router /phone20/online [DELETE]
//// @Security ApiKeyAuth
//func (dev *DCPhone20) delOnlineClose(c *gin.Context) {
// type st struct {
// DevID []uint32 `json:"devId"`
// }
// var data st
// if err := c.ShouldBindJSON(&data); err != nil {
// logger.Log.Error("c.ShouldBindJSON(&data)",
// zap.String("Src", "delOnlineClose"),
// zap.Error(err))
// c.JSON(http.StatusOK, gin.H{
// "code": api.ErrorReqParaFormat,
// "message": api.CodeMsg[api.ErrorReqParaFormat],
// })
// return
// }
//
// var dataOut resGetOnlineList
// dataOut.DevID = make(map[uint32]bool)
// for _, id := range data.DevID {
// if conn, ok := dev.ConnectMap.Load(id); ok {
// if c, ok := conn.(*net.TCPConn); ok { // 类型断言
// _ = c.Close()
// } /*else { // 类型断言失败
//
// }*/
// dev.ConnectMap.Delete(id)
// dataOut.Count++
// dataOut.DevID[id] = true
// } else {
// dataOut.DevID[id] = false
// }
// }
// c.JSON(http.StatusOK, gin.H{
// "code": api.Success,
// "data": dataOut,
// })
//}
// 以下为参数处理-----------------------------------------------------------------------------------------
// @Tags phone20
......@@ -202,7 +201,7 @@ func (dev *DCPhone20) getDevPara(c *gin.Context) {
zap.String("Src", "getDevPara"),
zap.Error(err))
c.JSON(http.StatusOK, gin.H{
"code": api.ErrorReqParaFormat,
"code": api.ErrorReqParaFormat,
"message": api.CodeMsg[api.ErrorReqParaFormat],
})
return
......@@ -229,12 +228,12 @@ func (dev *DCPhone20) getDevPara(c *gin.Context) {
}
}
c.JSON(http.StatusOK, gin.H{
"code": api.Success,
"data": dataOut,
"code": api.Success,
"data": dataOut,
})
} else {
c.JSON(http.StatusOK, gin.H{
"code": api.ErrorReqPara,
"code": api.ErrorReqPara,
"message": api.CodeMsg[api.ErrorReqPara] + ":参数未定义",
})
}
......@@ -314,7 +313,7 @@ func (dev *DCPhone20) setDevPara(c *gin.Context) {
sDevId = data.DevID
case "update_firmware":
var data paraOneString
if err := c.ShouldBindJSON(&data); err != nil || len(data.Value)==0{
if err := c.ShouldBindJSON(&data); err != nil || len(data.Value) == 0 {
logger.Log.Error("c.ShouldBindJSON(&data)",
zap.String("Src", "case \"update_firmware\""),
zap.Error(err))
......@@ -326,17 +325,17 @@ func (dev *DCPhone20) setDevPara(c *gin.Context) {
// 找文件服务器要MD5和大小
nowTime := time.Now().UnixMicro()
// /info/:token/:devType/:filename
ret := thirdapi.HttpGet(setting.FirmwareServerUrl + "/info/"+api.CreateToken(nowTime, 1, 4, uint32(nowTime/1000000) + 1800)+"/phone20/"+data.Value)
ret := thirdapi.HttpGet(setting.FirmwareServerUrl + "/info/" + api.CreateToken(nowTime, 1, 4, uint32(nowTime/1000000)+1800) + "/phone20/" + data.Value)
if ret == nil {
returnMsg = "文件服务器请求失败,请稍后重试"
sTcpData.CtrlCode = 0
returnState = 2002
break
}
var fileInfo struct{
var fileInfo struct {
Code uint16 `json:"code"`
Data struct{
MD5 []byte `json:"md5"`
Data struct {
MD5 []byte `json:"md5"`
Size uint32 `json:"size"`
} `json:"data"`
Message string `json:"message"`
......@@ -345,7 +344,7 @@ func (dev *DCPhone20) setDevPara(c *gin.Context) {
if err != nil {
logger.LogHttpClient.Error("fileServer get file info 1",
zap.String("fileName", data.Value),
zap.String("ret",string(ret)),
zap.String("ret", string(ret)),
zap.Error(err))
returnMsg = "文件服务器请求失败,请联系开发人员"
sTcpData.CtrlCode = 0
......@@ -364,7 +363,7 @@ func (dev *DCPhone20) setDevPara(c *gin.Context) {
if fileInfo.Data.Size == 0 {
logger.LogHttpClient.Error("fileServer get file info 3",
zap.String("fileName", data.Value),
zap.String("ret",string(ret)))
zap.String("ret", string(ret)))
returnMsg = "文件服务器请求错误,请联系开发人员"
sTcpData.CtrlCode = 0
returnState = 2002
......@@ -373,10 +372,10 @@ func (dev *DCPhone20) setDevPara(c *gin.Context) {
//md5Bytes := make([]byte, base64.StdEncoding.DecodedLen(len(fileInfo.Data.MD5Base64)))
//hexLen, err := base64.StdEncoding.Decode(md5Bytes, []byte(fileInfo.Data.MD5Base64))
if len(fileInfo.Data.MD5)!=16 {
if len(fileInfo.Data.MD5) != 16 {
logger.LogHttpClient.Error("fileServer get file info 3",
zap.String("fileName", data.Value),
zap.String("ret",string(ret)))
zap.String("ret", string(ret)))
returnMsg = "文件服务器请求错误,请联系开发人员"
sTcpData.CtrlCode = 0
returnState = 2002
......@@ -384,15 +383,15 @@ func (dev *DCPhone20) setDevPara(c *gin.Context) {
}
sTcpData.Data[0] = byte(fileInfo.Data.Size)
sTcpData.Data[1] = byte(fileInfo.Data.Size>>8)
sTcpData.Data[2] = byte(fileInfo.Data.Size>>16)
sTcpData.Data[3] = byte(fileInfo.Data.Size>>24)
copy(sTcpData.Data[4:],fileInfo.Data.MD5)
sLen := 20 + copy(sTcpData.Data[20:],data.Value)
sTcpData.Data[1] = byte(fileInfo.Data.Size >> 8)
sTcpData.Data[2] = byte(fileInfo.Data.Size >> 16)
sTcpData.Data[3] = byte(fileInfo.Data.Size >> 24)
copy(sTcpData.Data[4:], fileInfo.Data.MD5)
sLen := 20 + copy(sTcpData.Data[20:], data.Value)
sTcpData.Data[sLen] = '_'
sLen ++
sLen++
// /download/:token/:devType/:filename
sLen += copy(sTcpData.Data[sLen:],setting.FirmwareServerUrl + "/info/"+api.CreateToken(nowTime, 1, 3, uint32(nowTime/1000000) + 1800)+"/phone20/"+data.Value)
sLen += copy(sTcpData.Data[sLen:], setting.FirmwareServerUrl+"/info/"+api.CreateToken(nowTime, 1, 3, uint32(nowTime/1000000)+1800)+"/phone20/"+data.Value)
sTcpData.Length = byte(sLen)
sDevId = data.DevID
case "key_password", "restart_device": //
......
......@@ -19,19 +19,8 @@ import (
"time"
)
//type DCPhone10StateStruct struct{
// rTime time.Time
// csq0 uint8
// csq1 uint8
// state uint8
// m1state uint8
// m2state uint8
// errCode uint8
//}
type DCPhone20 struct {
dev_product.DCLongTCPHex
// MapDCPhone10State sync.Map
}
func (dev *DCPhone20) NewDCPhone20(password string, iv string, devType uint8) {
......
package dev_product
import (
"dc_golang_server_1/data_db_cache/dbcurd"
"dc_golang_server_1/logger"
config2 "dc_golang_server_1/util/setting"
"go.uber.org/zap"
"net"
"strconv"
"sync"
"sync/atomic"
"time"
)
type ITCPLongServer interface {
TCPStart(port string)
}
type receiveCallbackFunc func(*net.TCPConn, []byte, uint32) uint32 //定义接收到数据的回调函数的函数类型
type TCPLongServer struct {
TCPReceive receiveCallbackFunc
ConnSocketCount int32
ConnectMap sync.Map // 用这个可能性能不行,测试下,不行就用map加锁
// rwConnSocketCount chan int // 20210815 将对ConnSocketCount的操作修改为原子操作
// ConnectMapRWMutex sync.RWMutex
// ConnectMap map[uint32]*net.TCPConn // Connection
}
func (s *TCPLongServer) TCPStart(port string) {
go func() {
// 获取一个TCP的Addr
addr, err := net.ResolveTCPAddr("tcp4", "0.0.0.0:"+port)
if err != nil {
panic("error: net.ResolveTCPAddr " + port + err.Error())
}
// 监听服务器地址
listener, err := net.ListenTCP("tcp4", addr)
if err != nil {
logger.Log.Panic("net.ListenTCP:"+port,
zap.String("Src", "TCP-SERVER"),
zap.Error(err))
}
// 启动server
for {
conn, err1 := listener.AcceptTCP() // 阻塞等待客户端建立连接请求
if err1 != nil {
logger.Log.Warn("listener.AcceptTCP()",
zap.String("Src", "TCP-SERVER"),
zap.Error(err1))
continue
}
go s.connectionHandle(conn, s.TCPReceive)
}
}()
}
// 主动断开某链接,其实在新连接上来的时候,可以查下如果map里面有现在的设备号,就可以把旧的断掉
//func (s *TCPLongServer) DeleteConnection(key uint32){
// if conn,ok := s.ConnectMap.Load(key);ok {
// if c,ok := conn.(*net.TCPConn);ok{ // 类型断言
// c.Close()
// }
// }
// s.ConnectMap.Delete(key)
// log.WithFields(log.Fields{
// "Src": "TCP-SERVER-DeleteConnection",
// "DevID": key,
// "Conn":conn.RemoteAddr(),
// "State": "offline",
// }).Debugln("conn.Write(sendStr) error")
//}
func (s *TCPLongServer) connectionHandle(conn *net.TCPConn, callBack receiveCallbackFunc) {
var myDevID uint32 // golang 默认0
atomic.AddInt32(&s.ConnSocketCount, 1)
defer func() {
//s.rwConnSocketCount <- -1
if s.ConnSocketCount > 0 {
atomic.AddInt32(&s.ConnSocketCount, -1)
} else {
logger.Log.Error("s.ConnSocketCount error",
zap.String("Src", "TCP-SERVER-connectionHandle"),
zap.Uint32("DevID", myDevID),
zap.String("Conn", conn.RemoteAddr().String()),
zap.Int32("ConnSocketCount", s.ConnSocketCount))
}
if myDevID != 0 {
if connMyID, ok := s.ConnectMap.Load(myDevID); ok { //查一下设备旧链接还在的话,关掉
if co, ok := connMyID.(*net.TCPConn); ok { // 类型断言
if co == conn {
s.ConnectMap.Delete(myDevID)
dbcurd.DevConnectRecord(myDevID, 1) // state 0:新连接来了 1:设备正常离线 2:正常离线 3:新连接挤掉就连接 4:未知异常(连接池类型断言失败)
//logger.Log.Debug("device offline",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.String("State", "offline"))
} else {
// s.ConnectMap.Delete(myDevID) 这里人家存了新的,不能去删了噻
dbcurd.DevConnectRecord(myDevID, 3) // state 0:新连接来了 1:设备正常离线 2:正常离线 3:新连接挤掉就连接 4:未知异常(连接池类型断言失败)
//logger.Log.Debug("have a new link,close old link",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.String("State", "offline"))
}
} else {
s.ConnectMap.Delete(myDevID)
//logger.Log.Error("connMyID.(*net.TCPConn) != ok",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.String("State", "offline")) // 类型断言失败
dbcurd.DevConnectRecord(myDevID, 4) // state 0:新连接来了 1:设备正常离线 2:正常离线 3:新连接挤掉就连接 4:未知异常(连接池类型断言失败)
}
} else {
//logger.Log.Debug("map no have myDevID",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.String("State", "offline"))
dbcurd.DevConnectRecord(myDevID, 2) // state 0:新连接来了 1:设备正常离线 2:正常离线 3:新连接挤掉就连接 4:未知异常(连接池类型断言失败)
}
}
// _ = conn.SetReadDeadline(time.Time{}) // 设置回去,但是不知道需不需要这句话
_ = conn.Close()
// fmt.Println("-----------------------------------Out ConnSocketCount:", s.ConnSocketCount)
}()
if s.ConnSocketCount > config2.TcpLongMaxConnections { //限制最大连接数2万个配置文件 最大连接限制数添加到配置文件
logger.Log.Error("ConnSocketCount overrun:"+strconv.Itoa(int(config2.TcpLongMaxConnections)),
zap.String("Src", "TCP-SERVER-connectionHandle"),
zap.Uint32("DevID", myDevID),
zap.String("Conn", conn.RemoteAddr().String()),
zap.Int32("ConnSocketCount", s.ConnSocketCount))
return
}
_ = conn.SetKeepAlive(false)
buf := make([]byte, 512)
rBuf := make([]byte, 512)
rLen := 0
i := 0
timeConn := time.Now().Unix() + config2.TcpLongNewConnRightfulTimeout //配置文件 120秒
for {
if myDevID == 0 {
if time.Now().Unix() > timeConn { // 连上来2分钟都没整个正确的数据来,就给它断球
logger.Log.Warn("NewConnRightfulTimeout:"+strconv.Itoa(int(config2.TcpLongNewConnRightfulTimeout)), // 超时没收到合法的指令
zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
zap.String("Conn", conn.RemoteAddr().String()),
zap.Int32("ConnSocketCount", s.ConnSocketCount))
return
}
if err := conn.SetReadDeadline(time.Now().Add(config2.TcpLongNewConnReadDeadline)); err != nil { // 配置文件 新连接1分钟超时未收到数据(配置文件用秒)
logger.Log.Warn("conn.SetReadDeadline:new", //
zap.String("Src", "TCP-SERVER-connectionHandle"),
zap.Uint32("DevID", myDevID),
zap.String("Conn", conn.RemoteAddr().String()),
zap.Error(err),
zap.Int32("ConnSocketCount", s.ConnSocketCount))
return
}
} else {
if err := conn.SetReadDeadline(time.Now().Add(config2.TcpLongOldConnReadDeadline)); err != nil { // 配置文件 老连接3分钟超时未收到数据(配置文件用秒)
logger.Log.Warn("conn.SetReadDeadline:old", //
zap.String("Src", "TCP-SERVER-connectionHandle"),
zap.Uint32("DevID", myDevID),
zap.String("Conn", conn.RemoteAddr().String()),
zap.Error(err),
zap.Int32("ConnSocketCount", s.ConnSocketCount))
return
}
}
cnt, err := conn.Read(buf)
if err != nil {
// fmt.Println("conn.Read:", err)
// logger debug 其中存在超时,或新连接来关闭了旧链接
logger.Log.Info("read error",
zap.String("Src", "TCP-SERVER-connectionHandle"),
zap.Uint32("DevID", myDevID),
zap.String("Conn", conn.RemoteAddr().String()),
zap.Error(err))
return
}
for i = 0; i < cnt; i++ {
if rBuf[0] != '{' || rLen == 0 {
if buf[i] == '{' {
rBuf[0] = '{'
rLen = 1
} else {
rLen = 0
}
} else if buf[i] == '}' {
if rLen == 1 {
if i+1 == cnt { //只有当后面没跟其他数据的时候,才回空心跳
if _, err2 := conn.Write([]byte("[]")); err2 != nil {
return
}
}
} else {
newID := callBack(conn, rBuf[1:rLen], myDevID)
if newID == 0 {
return
} else if newID != myDevID {
if myDevID == 0 {
if connOld, ok := s.ConnectMap.Load(newID); ok { //查一下设备旧链接还在的话,关掉
if co, ok1 := connOld.(*net.TCPConn); ok1 { // 类型断言
s.ConnectMap.Store(newID, conn) //先存新的再关
_ = co.Close()
} /* else {
s.ConnectMap.Delete(newID)
fmt.Printf("newID : s.ConnectMap.类型断言(%08X)错误\n",newID)
// logger 类型断言不OK
}*/
}
// logger 新链接来的合法设备
dbcurd.DevConnectRecord(newID, 0)
//logger.Log.Debug("a new link is coming",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", newID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.String("State", "online"))
} else {
s.ConnectMap.Delete(myDevID)
logger.Log.Error("DevID changed",
zap.String("Src", "TCP-SERVER-connectionHandle"),
zap.Uint32("OldDevId", myDevID),
zap.Uint32("NewDevId", newID),
zap.String("Conn", conn.RemoteAddr().String()))
}
s.ConnectMap.Store(newID, conn)
myDevID = newID
} else { //这个地方应该查下map里面有没有,没有就是没对
if connMyID, ok := s.ConnectMap.Load(myDevID); ok { //
if co, ok2 := connMyID.(*net.TCPConn); ok2 { // 类型断言
if co != conn {
s.ConnectMap.Store(myDevID, conn)
logger.Log.Error("co != conn",
zap.String("Src", "TCP-SERVER-connectionHandle"),
zap.Uint32("DevID", myDevID),
zap.String("Conn", conn.RemoteAddr().String()),
zap.String("State", "restore myDevId"))
}
} else {
s.ConnectMap.Store(myDevID, conn)
logger.Log.Error("connMyID.(*net.TCPConn) != ok",
zap.String("Src", "TCP-SERVER-connectionHandle"),
zap.Uint32("DevID", myDevID),
zap.String("Conn", conn.RemoteAddr().String()),
zap.String("State", "restore myDevId")) // 类型断言失败
}
} else {
s.ConnectMap.Store(myDevID, conn)
logger.Log.Error("map no myDevID",
zap.String("Src", "TCP-SERVER-connectionHandle"),
zap.Uint32("DevID", myDevID),
zap.String("Conn", conn.RemoteAddr().String()),
zap.String("State", "restore myDevId"))
}
}
}
rLen = 0
} else if buf[i] == '{' {
rBuf[0] = '{'
rLen = 1
} else {
rBuf[rLen] = buf[i]
if rLen < 512 {
rLen++
} else {
logger.Log.Warn("rBufOverrun:512",
zap.String("Src", "TCP-SERVER-connectionHandle"),
zap.Uint8s("RBuf", rBuf),
zap.Int("RLen", rLen),
// zap.Uint32("DevID", myDevID),
zap.String("Conn", conn.RemoteAddr().String()))
rLen = 0
}
}
}
}
}
package dev_product
//import (
// "dc_golang_server_1/data_db_cache/dbcurd"
// "dc_golang_server_1/logger"
// config2 "dc_golang_server_1/util/setting"
// "go.uber.org/zap"
// "net"
// "strconv"
// "sync"
// "sync/atomic"
// "time"
//)
//
//type ITCPLongServer interface {
// TCPStart(port string)
//}
//
//type receiveCallbackFunc func(*net.TCPConn, []byte, uint32) uint32 //定义接收到数据的回调函数的函数类型
//
//type TCPLongServer struct {
// TCPReceive receiveCallbackFunc
// ConnSocketCount int32
// ConnectMap sync.Map // 用这个可能性能不行,测试下,不行就用map加锁
// // rwConnSocketCount chan int // 20210815 将对ConnSocketCount的操作修改为原子操作
// // ConnectMapRWMutex sync.RWMutex
// // ConnectMap map[uint32]*net.TCPConn // Connection
//}
//
//func (s *TCPLongServer) TCPStart(port string) {
// go func() {
// // 获取一个TCP的Addr
// addr, err := net.ResolveTCPAddr("tcp4", "0.0.0.0:"+port)
// if err != nil {
// panic("error: net.ResolveTCPAddr " + port + err.Error())
// }
//
// // 监听服务器地址
// listener, err := net.ListenTCP("tcp4", addr)
// if err != nil {
// logger.Log.Panic("net.ListenTCP:"+port,
// zap.String("Src", "TCP-SERVER"),
// zap.Error(err))
// }
//
// // 启动server
// for {
// conn, err1 := listener.AcceptTCP() // 阻塞等待客户端建立连接请求
// if err1 != nil {
// logger.Log.Warn("listener.AcceptTCP()",
// zap.String("Src", "TCP-SERVER"),
// zap.Error(err1))
// continue
// }
//
// go s.connectionHandle(conn, s.TCPReceive)
// }
// }()
//}
//
//// 主动断开某链接,其实在新连接上来的时候,可以查下如果map里面有现在的设备号,就可以把旧的断掉
////func (s *TCPLongServer) DeleteConnection(key uint32){
//// if conn,ok := s.ConnectMap.Load(key);ok {
//// if c,ok := conn.(*net.TCPConn);ok{ // 类型断言
//// c.Close()
//// }
//// }
//// s.ConnectMap.Delete(key)
//// log.WithFields(log.Fields{
//// "Src": "TCP-SERVER-DeleteConnection",
//// "DevID": key,
//// "Conn":conn.RemoteAddr(),
//// "State": "offline",
//// }).Debugln("conn.Write(sendStr) error")
////}
//
//func (s *TCPLongServer) connectionHandle(conn *net.TCPConn, callBack receiveCallbackFunc) {
// var myDevID uint32 // golang 默认0
// atomic.AddInt32(&s.ConnSocketCount, 1)
// defer func() {
// //s.rwConnSocketCount <- -1
// if s.ConnSocketCount > 0 {
// atomic.AddInt32(&s.ConnSocketCount, -1)
// } else {
// logger.Log.Error("s.ConnSocketCount error",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.Int32("ConnSocketCount", s.ConnSocketCount))
// }
// if myDevID != 0 {
// if connMyID, ok := s.ConnectMap.Load(myDevID); ok { //查一下设备旧链接还在的话,关掉
// if co, ok := connMyID.(*net.TCPConn); ok { // 类型断言
// if co == conn {
// s.ConnectMap.Delete(myDevID)
// dbcurd.DevConnectRecord(myDevID, 1) // state 0:新连接来了 1:设备正常离线 2:正常离线 3:新连接挤掉就连接 4:未知异常(连接池类型断言失败)
// //logger.Log.Debug("device offline",
// // zap.String("Src", "TCP-SERVER-connectionHandle"),
// // zap.Uint32("DevID", myDevID),
// // zap.String("Conn", conn.RemoteAddr().String()),
// // zap.String("State", "offline"))
// } else {
// // s.ConnectMap.Delete(myDevID) 这里人家存了新的,不能去删了噻
// dbcurd.DevConnectRecord(myDevID, 3) // state 0:新连接来了 1:设备正常离线 2:正常离线 3:新连接挤掉就连接 4:未知异常(连接池类型断言失败)
// //logger.Log.Debug("have a new link,close old link",
// // zap.String("Src", "TCP-SERVER-connectionHandle"),
// // zap.Uint32("DevID", myDevID),
// // zap.String("Conn", conn.RemoteAddr().String()),
// // zap.String("State", "offline"))
// }
// } else {
// s.ConnectMap.Delete(myDevID)
// //logger.Log.Error("connMyID.(*net.TCPConn) != ok",
// // zap.String("Src", "TCP-SERVER-connectionHandle"),
// // zap.Uint32("DevID", myDevID),
// // zap.String("Conn", conn.RemoteAddr().String()),
// // zap.String("State", "offline")) // 类型断言失败
// dbcurd.DevConnectRecord(myDevID, 4) // state 0:新连接来了 1:设备正常离线 2:正常离线 3:新连接挤掉就连接 4:未知异常(连接池类型断言失败)
// }
// } else {
// //logger.Log.Debug("map no have myDevID",
// // zap.String("Src", "TCP-SERVER-connectionHandle"),
// // zap.Uint32("DevID", myDevID),
// // zap.String("Conn", conn.RemoteAddr().String()),
// // zap.String("State", "offline"))
// dbcurd.DevConnectRecord(myDevID, 2) // state 0:新连接来了 1:设备正常离线 2:正常离线 3:新连接挤掉就连接 4:未知异常(连接池类型断言失败)
// }
//
// }
// // _ = conn.SetReadDeadline(time.Time{}) // 设置回去,但是不知道需不需要这句话
// _ = conn.Close()
// // fmt.Println("-----------------------------------Out ConnSocketCount:", s.ConnSocketCount)
// }()
//
// if s.ConnSocketCount > config2.TcpLongMaxConnections { //限制最大连接数2万个配置文件 最大连接限制数添加到配置文件
// logger.Log.Error("ConnSocketCount overrun:"+strconv.Itoa(int(config2.TcpLongMaxConnections)),
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.Int32("ConnSocketCount", s.ConnSocketCount))
// return
// }
//
// _ = conn.SetKeepAlive(false)
// buf := make([]byte, 512)
// rBuf := make([]byte, 512)
// rLen := 0
// i := 0
// timeConn := time.Now().Unix() + config2.TcpLongNewConnRightfulTimeout //配置文件 120秒
// for {
// if myDevID == 0 {
// if time.Now().Unix() > timeConn { // 连上来2分钟都没整个正确的数据来,就给它断球
// logger.Log.Warn("NewConnRightfulTimeout:"+strconv.Itoa(int(config2.TcpLongNewConnRightfulTimeout)), // 超时没收到合法的指令
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// // zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.Int32("ConnSocketCount", s.ConnSocketCount))
// return
// }
// if err := conn.SetReadDeadline(time.Now().Add(config2.TcpLongNewConnReadDeadline)); err != nil { // 配置文件 新连接1分钟超时未收到数据(配置文件用秒)
// logger.Log.Warn("conn.SetReadDeadline:new", //
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.Error(err),
// zap.Int32("ConnSocketCount", s.ConnSocketCount))
// return
// }
// } else {
// if err := conn.SetReadDeadline(time.Now().Add(config2.TcpLongOldConnReadDeadline)); err != nil { // 配置文件 老连接3分钟超时未收到数据(配置文件用秒)
// logger.Log.Warn("conn.SetReadDeadline:old", //
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.Error(err),
// zap.Int32("ConnSocketCount", s.ConnSocketCount))
// return
// }
// }
// cnt, err := conn.Read(buf)
// if err != nil {
// // fmt.Println("conn.Read:", err)
// // logger debug 其中存在超时,或新连接来关闭了旧链接
// logger.Log.Info("read error",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.Error(err))
// return
// }
//
// for i = 0; i < cnt; i++ {
// if rBuf[0] != '{' || rLen == 0 {
// if buf[i] == '{' {
// rBuf[0] = '{'
// rLen = 1
// } else {
// rLen = 0
// }
// } else if buf[i] == '}' {
// if rLen == 1 {
// if i+1 == cnt { //只有当后面没跟其他数据的时候,才回空心跳
// if _, err2 := conn.Write([]byte("[]")); err2 != nil {
// return
// }
// }
// } else {
// newID := callBack(conn, rBuf[1:rLen], myDevID)
// if newID == 0 {
// return
// } else if newID != myDevID {
// if myDevID == 0 {
// if connOld, ok := s.ConnectMap.Load(newID); ok { //查一下设备旧链接还在的话,关掉
// if co, ok1 := connOld.(*net.TCPConn); ok1 { // 类型断言
// s.ConnectMap.Store(newID, conn) //先存新的再关
// _ = co.Close()
// } /* else {
// s.ConnectMap.Delete(newID)
// fmt.Printf("newID : s.ConnectMap.类型断言(%08X)错误\n",newID)
// // logger 类型断言不OK
// }*/
// }
// // logger 新链接来的合法设备
// dbcurd.DevConnectRecord(newID, 0)
// //logger.Log.Debug("a new link is coming",
// // zap.String("Src", "TCP-SERVER-connectionHandle"),
// // zap.Uint32("DevID", newID),
// // zap.String("Conn", conn.RemoteAddr().String()),
// // zap.String("State", "online"))
// } else {
// s.ConnectMap.Delete(myDevID)
// logger.Log.Error("DevID changed",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("OldDevId", myDevID),
// zap.Uint32("NewDevId", newID),
// zap.String("Conn", conn.RemoteAddr().String()))
// }
// s.ConnectMap.Store(newID, conn)
// myDevID = newID
// } else { //这个地方应该查下map里面有没有,没有就是没对
// if connMyID, ok := s.ConnectMap.Load(myDevID); ok { //
// if co, ok2 := connMyID.(*net.TCPConn); ok2 { // 类型断言
// if co != conn {
// s.ConnectMap.Store(myDevID, conn)
// logger.Log.Error("co != conn",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.String("State", "restore myDevId"))
// }
// } else {
// s.ConnectMap.Store(myDevID, conn)
// logger.Log.Error("connMyID.(*net.TCPConn) != ok",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.String("State", "restore myDevId")) // 类型断言失败
// }
// } else {
// s.ConnectMap.Store(myDevID, conn)
// logger.Log.Error("map no myDevID",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()),
// zap.String("State", "restore myDevId"))
// }
// }
// }
// rLen = 0
// } else if buf[i] == '{' {
// rBuf[0] = '{'
// rLen = 1
// } else {
// rBuf[rLen] = buf[i]
// if rLen < 512 {
// rLen++
// } else {
// logger.Log.Warn("rBufOverrun:512",
// zap.String("Src", "TCP-SERVER-connectionHandle"),
// zap.Uint8s("RBuf", rBuf),
// zap.Int("RLen", rLen),
// // zap.Uint32("DevID", myDevID),
// zap.String("Conn", conn.RemoteAddr().String()))
// rLen = 0
// }
// }
// }
// }
//}
......@@ -194,134 +194,6 @@ var doc = `{
}
}
},
"/phone20/online": {
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "主动关闭设备链接",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"phone20"
],
"summary": "主动关闭设备链接[complete]",
"parameters": [
{
"description": "入参",
"name": "ids",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dcphone20.reqIDs"
}
}
],
"responses": {
"0": {
"description": "出参",
"schema": {
"$ref": "#/definitions/dcphone20.resGetOnlineList"
}
}
}
}
},
"/phone20/online/all": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "查整个在线设备列表",
"produces": [
"application/json"
],
"tags": [
"phone20"
],
"summary": "查整个在线设备列表[complete]",
"responses": {
"0": {
"description": "出参",
"schema": {
"$ref": "#/definitions/dcphone20.resGetOnlineAll"
}
}
}
}
},
"/phone20/online/list": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "根据设备ID,查询是否在线",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"phone20"
],
"summary": "查设备是否在线[complete]",
"parameters": [
{
"description": "入参",
"name": "ids",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dcphone20.reqIDs"
}
}
],
"responses": {
"0": {
"description": "出参",
"schema": {
"$ref": "#/definitions/dcphone20.resGetOnlineList"
}
}
}
}
},
"/phone20/online/num": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "查在线设备总数量",
"produces": [
"application/json"
],
"tags": [
"phone20"
],
"summary": "查在线设备总数量[complete]",
"responses": {
"0": {
"description": "出参",
"schema": {
"$ref": "#/definitions/dcphone20.resGetOnlineTotal"
}
}
}
}
},
"/phone20/para/:paraName": {
"get": {
"security": [
......@@ -1729,16 +1601,12 @@ var doc = `{
"$ref": "#/definitions/util.Disk"
},
"httpReqNo": {
"description": "当前http请求数",
"description": "PhoneTcpSocketNo int32 ` + "`" + `json:\"phoneSocketNo\"` + "`" + ` // 电话机Socket连接数",
"type": "integer"
},
"os": {
"$ref": "#/definitions/util.Os"
},
"phoneSocketNo": {
"description": "电话机Socket连接数",
"type": "integer"
},
"ram": {
"$ref": "#/definitions/util.Ram"
}
......@@ -2212,23 +2080,6 @@ var doc = `{
}
}
},
"dcphone20.resGetOnlineAll": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"devID": {
"type": "array",
"items": {
"type": "integer"
}
},
"socket": {
"type": "integer"
}
}
},
"dcphone20.resGetOnlineList": {
"type": "object",
"properties": {
......@@ -2243,17 +2094,6 @@ var doc = `{
}
}
},
"dcphone20.resGetOnlineTotal": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"socket": {
"type": "integer"
}
}
},
"model.CacheBDistrictStruct": {
"type": "object",
"properties": {
......@@ -2457,7 +2297,7 @@ var SwaggerInfo = swaggerInfo{
BasePath: "/",
Schemes: []string{},
Title: "多彩中小学一卡通系统",
Description: "头像上传下载变化\n2022-02-08 头像上传下载接口调整为:(POST上传\"baseurl/png\")/(GET下载小头像\"baseurl/small/{id}\")/(GET下载大头像\"baseurl/big/{id}\")\n2022-02-08 去掉 [根据学生ID获取学生头像上传的token]和[根据学生ID获取学生大头像下载的url] 接口\n2022-02-08 [通过邀请码获取学生预览信息]去掉avatar字段,增加id字段,根据ID拿大小头像,用户可点击小头像展示大头像\n2022-02-08 [获取学生列表]、[获取单个学生信息]、[获取单个学生信息和最新动态]去掉Avatar字段\n2022-02-08 公话卡页面,增加一个ICON(客服电话),增加根据区服务ID查询区域服务服务电话,后台区域服务增加该字段 /we/areaservicephone\n2022-02-08 增加 云家信 用户协议 \"https://k12.dcrym.com/other/agreement.html\"\n/we/paylist 接口调整\n/we/pay 接口调整\n/we/payrecord 接口调整\n/we/payrecord/{aid} [GET] 接口增加字段",
Description: "头像上传下载变化\n2022-02-08 头像上传下载接口调整为:(POST上传\"baseurl/png\")/(GET下载小头像\"baseurl/small/{id}\")/(GET下载大头像\"baseurl/big/{id}\")\n2022-02-08 去掉 [根据学生ID获取学生头像上传的token]和[根据学生ID获取学生大头像下载的url] 接口\n2022-02-08 [通过邀请码获取学生预览信息]去掉avatar字段,增加id字段,根据ID拿大小头像,用户可点击小头像展示大头像\n2022-02-08 [获取学生列表]、[获取单个学生信息]、[获取单个学生信息和最新动态]去掉Avatar字段\n2022-02-08 公话卡页面,增加一个ICON(客服电话),增加根据区服务ID查询区域服务服务电话,后台区域服务增加该字段 /we/areaservicephone\n2022-02-08 增加 云家信 用户协议 \"https://k12.dcrym.com/other/agreement.html\"\n/we/paylist 接口调整\n/we/pay 接口调整\n/we/payrecord 接口调整\n/we/payrecord/{aid} [GET] 接口增加字段\n2022-02-26 /serverops/sysstate [GET] 取消PhoneTcpSocketNo字段,在adminServer去增加,因为连接硬件的服务从本服务剥离出去了",
}
type s struct{}
......
{
"swagger": "2.0",
"info": {
"description": "头像上传下载变化\n2022-02-08 头像上传下载接口调整为:(POST上传\"baseurl/png\")/(GET下载小头像\"baseurl/small/{id}\")/(GET下载大头像\"baseurl/big/{id}\")\n2022-02-08 去掉 [根据学生ID获取学生头像上传的token]和[根据学生ID获取学生大头像下载的url] 接口\n2022-02-08 [通过邀请码获取学生预览信息]去掉avatar字段,增加id字段,根据ID拿大小头像,用户可点击小头像展示大头像\n2022-02-08 [获取学生列表]、[获取单个学生信息]、[获取单个学生信息和最新动态]去掉Avatar字段\n2022-02-08 公话卡页面,增加一个ICON(客服电话),增加根据区服务ID查询区域服务服务电话,后台区域服务增加该字段 /we/areaservicephone\n2022-02-08 增加 云家信 用户协议 \"https://k12.dcrym.com/other/agreement.html\"\n/we/paylist 接口调整\n/we/pay 接口调整\n/we/payrecord 接口调整\n/we/payrecord/{aid} [GET] 接口增加字段",
"description": "头像上传下载变化\n2022-02-08 头像上传下载接口调整为:(POST上传\"baseurl/png\")/(GET下载小头像\"baseurl/small/{id}\")/(GET下载大头像\"baseurl/big/{id}\")\n2022-02-08 去掉 [根据学生ID获取学生头像上传的token]和[根据学生ID获取学生大头像下载的url] 接口\n2022-02-08 [通过邀请码获取学生预览信息]去掉avatar字段,增加id字段,根据ID拿大小头像,用户可点击小头像展示大头像\n2022-02-08 [获取学生列表]、[获取单个学生信息]、[获取单个学生信息和最新动态]去掉Avatar字段\n2022-02-08 公话卡页面,增加一个ICON(客服电话),增加根据区服务ID查询区域服务服务电话,后台区域服务增加该字段 /we/areaservicephone\n2022-02-08 增加 云家信 用户协议 \"https://k12.dcrym.com/other/agreement.html\"\n/we/paylist 接口调整\n/we/pay 接口调整\n/we/payrecord 接口调整\n/we/payrecord/{aid} [GET] 接口增加字段\n2022-02-26 /serverops/sysstate [GET] 取消PhoneTcpSocketNo字段,在adminServer去增加,因为连接硬件的服务从本服务剥离出去了",
"title": "多彩中小学一卡通系统",
"contact": {},
"version": "V0.0.9"
......@@ -179,134 +179,6 @@
}
}
},
"/phone20/online": {
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "主动关闭设备链接",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"phone20"
],
"summary": "主动关闭设备链接[complete]",
"parameters": [
{
"description": "入参",
"name": "ids",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dcphone20.reqIDs"
}
}
],
"responses": {
"0": {
"description": "出参",
"schema": {
"$ref": "#/definitions/dcphone20.resGetOnlineList"
}
}
}
}
},
"/phone20/online/all": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "查整个在线设备列表",
"produces": [
"application/json"
],
"tags": [
"phone20"
],
"summary": "查整个在线设备列表[complete]",
"responses": {
"0": {
"description": "出参",
"schema": {
"$ref": "#/definitions/dcphone20.resGetOnlineAll"
}
}
}
}
},
"/phone20/online/list": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "根据设备ID,查询是否在线",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"phone20"
],
"summary": "查设备是否在线[complete]",
"parameters": [
{
"description": "入参",
"name": "ids",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dcphone20.reqIDs"
}
}
],
"responses": {
"0": {
"description": "出参",
"schema": {
"$ref": "#/definitions/dcphone20.resGetOnlineList"
}
}
}
}
},
"/phone20/online/num": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "查在线设备总数量",
"produces": [
"application/json"
],
"tags": [
"phone20"
],
"summary": "查在线设备总数量[complete]",
"responses": {
"0": {
"description": "出参",
"schema": {
"$ref": "#/definitions/dcphone20.resGetOnlineTotal"
}
}
}
}
},
"/phone20/para/:paraName": {
"get": {
"security": [
......@@ -1714,16 +1586,12 @@
"$ref": "#/definitions/util.Disk"
},
"httpReqNo": {
"description": "当前http请求数",
"description": "PhoneTcpSocketNo int32 `json:\"phoneSocketNo\"` // 电话机Socket连接数",
"type": "integer"
},
"os": {
"$ref": "#/definitions/util.Os"
},
"phoneSocketNo": {
"description": "电话机Socket连接数",
"type": "integer"
},
"ram": {
"$ref": "#/definitions/util.Ram"
}
......@@ -2197,23 +2065,6 @@
}
}
},
"dcphone20.resGetOnlineAll": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"devID": {
"type": "array",
"items": {
"type": "integer"
}
},
"socket": {
"type": "integer"
}
}
},
"dcphone20.resGetOnlineList": {
"type": "object",
"properties": {
......@@ -2228,17 +2079,6 @@
}
}
},
"dcphone20.resGetOnlineTotal": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"socket": {
"type": "integer"
}
}
},
"model.CacheBDistrictStruct": {
"type": "object",
"properties": {
......
......@@ -31,13 +31,10 @@ definitions:
disk:
$ref: '#/definitions/util.Disk'
httpReqNo:
description: 当前http请求
description: PhoneTcpSocketNo int32 `json:"phoneSocketNo"` // 电话机Socket连接
type: integer
os:
$ref: '#/definitions/util.Os'
phoneSocketNo:
description: 电话机Socket连接数
type: integer
ram:
$ref: '#/definitions/util.Ram'
type: object
......@@ -381,17 +378,6 @@ definitions:
type: integer
type: array
type: object
dcphone20.resGetOnlineAll:
properties:
count:
type: integer
devID:
items:
type: integer
type: array
socket:
type: integer
type: object
dcphone20.resGetOnlineList:
properties:
count:
......@@ -401,13 +387,6 @@ definitions:
type: boolean
type: object
type: object
dcphone20.resGetOnlineTotal:
properties:
count:
type: integer
socket:
type: integer
type: object
model.CacheBDistrictStruct:
properties:
id:
......@@ -549,6 +528,7 @@ info:
/we/pay 接口调整
/we/payrecord 接口调整
/we/payrecord/{aid} [GET] 接口增加字段
2022-02-26 /serverops/sysstate [GET] 取消PhoneTcpSocketNo字段,在adminServer去增加,因为连接硬件的服务从本服务剥离出去了
title: 多彩中小学一卡通系统
version: V0.0.9
paths:
......@@ -662,84 +642,6 @@ paths:
summary: 获取全国省份列表 [complete]
tags:
- 公用接口
/phone20/online:
delete:
consumes:
- application/json
description: 主动关闭设备链接
parameters:
- description: 入参
in: body
name: ids
required: true
schema:
$ref: '#/definitions/dcphone20.reqIDs'
produces:
- application/json
responses:
"0":
description: 出参
schema:
$ref: '#/definitions/dcphone20.resGetOnlineList'
security:
- ApiKeyAuth: []
summary: 主动关闭设备链接[complete]
tags:
- phone20
/phone20/online/all:
get:
description: 查整个在线设备列表
produces:
- application/json
responses:
"0":
description: 出参
schema:
$ref: '#/definitions/dcphone20.resGetOnlineAll'
security:
- ApiKeyAuth: []
summary: 查整个在线设备列表[complete]
tags:
- phone20
/phone20/online/list:
get:
consumes:
- application/json
description: 根据设备ID,查询是否在线
parameters:
- description: 入参
in: body
name: ids
required: true
schema:
$ref: '#/definitions/dcphone20.reqIDs'
produces:
- application/json
responses:
"0":
description: 出参
schema:
$ref: '#/definitions/dcphone20.resGetOnlineList'
security:
- ApiKeyAuth: []
summary: 查设备是否在线[complete]
tags:
- phone20
/phone20/online/num:
get:
description: 查在线设备总数量
produces:
- application/json
responses:
"0":
description: 出参
schema:
$ref: '#/definitions/dcphone20.resGetOnlineTotal'
security:
- ApiKeyAuth: []
summary: 查在线设备总数量[complete]
tags:
- phone20
/phone20/para/:paraName:
get:
consumes:
......
package GrpcFromDeviceConn
import (
deviceConnServer "dc_golang_server_1/my_grpc/grpc_deviceConnServer"
"dc_golang_server_1/util/setting"
"google.golang.org/grpc"
)
var grpcConn *grpc.ClientConn
var Client deviceConnServer.DeviceConnClient
func Init() {
var err error
grpcConn, err = grpc.Dial(setting.GrpcFromDeviceConnServerIpPort, grpc.WithInsecure())
if err != nil {
panic(err)
}
Client = deviceConnServer.NewDeviceConnClient(grpcConn)
}
func CloseGrpc() {
if grpcConn != nil {
_ = grpcConn.Close()
}
}
package grpc_server
package Grpc2Admin
import (
"context"
"dc_golang_server_1/data_db_cache/cache"
"dc_golang_server_1/data_db_cache/model"
myGRPC "dc_golang_server_1/my_grpc/grpc_area_map"
myGRPC "dc_golang_server_1/my_grpc/grpc_k122Server"
"errors"
)
//protoc --go_out=. -I=C:/Users/Administrator/go/pkg/mod/github.com/protocolbuffers/protobuf@v3.19.1+incompatible/src -I=. google/protobuf/empty.proto --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./grpc_area_map/areaMap.proto
type Server struct {
myGRPC.UnimplementedMyGrpcServer
type ToAdminServer struct {
myGRPC.UnimplementedGrpc2AdminServer
}
func (s *Server) CacheAddArea( ctx context.Context,req *myGRPC.CacheAreaReq) (*myGRPC.Empty,error) {
func (s *ToAdminServer) CacheAddArea(ctx context.Context, req *myGRPC.CacheAreaReq) (*myGRPC.Empty, error) {
if req == nil {
return new(myGRPC.Empty),errors.New("入参不能为空")
return new(myGRPC.Empty), errors.New("入参不能为空")
}
if req.AreaID == 0 {
return new(myGRPC.Empty),errors.New("校区ID错误")
return new(myGRPC.Empty), errors.New("校区ID错误")
}
if req.CountyID <543 || req.CountyID>3423 {
return new(myGRPC.Empty),errors.New("区县ID错误")
if req.CountyID < 543 || req.CountyID > 3423 {
return new(myGRPC.Empty), errors.New("区县ID错误")
}
return new(myGRPC.Empty),cache.CreatAreaMapAndUpdateCountyAreaMap(req.AreaID,&model.CacheBAreaStruct{
return new(myGRPC.Empty), cache.CreatAreaMapAndUpdateCountyAreaMap(req.AreaID, &model.CacheBAreaStruct{
Name: req.Name,
Longitude: req.Longitude,
Latitude: req.Latitude,
CountyID: req.CountyID,
CountyID: req.CountyID,
Status: uint8(req.Status),
})
}
func (s *Server) CacheUpdateArea( ctx context.Context,req *myGRPC.CacheAreaReq) (*myGRPC.Empty,error) {
func (s *ToAdminServer) CacheUpdateArea(ctx context.Context, req *myGRPC.CacheAreaReq) (*myGRPC.Empty, error) {
if req == nil {
return new(myGRPC.Empty),errors.New("入参不能为空")
return new(myGRPC.Empty), errors.New("入参不能为空")
}
//if req.AreaID == 0 { // 等那边保证数据正确
// return new(myGRPC.Empty),errors.New("校区ID错误")
......@@ -44,11 +44,11 @@ func (s *Server) CacheUpdateArea( ctx context.Context,req *myGRPC.CacheAreaReq)
// return new(myGRPC.Empty),errors.New("区县ID错误")
//}
return new(myGRPC.Empty),cache.UpdateAreaMapAndUpdateCountyAreaMap(req.AreaID,&model.CacheBAreaStruct{
return new(myGRPC.Empty), cache.UpdateAreaMapAndUpdateCountyAreaMap(req.AreaID, &model.CacheBAreaStruct{
Name: req.Name,
Longitude: req.Longitude,
Latitude: req.Latitude,
CountyID: req.CountyID,
CountyID: req.CountyID,
Status: uint8(req.Status),
})
}
\ No newline at end of file
}
package grpc_server
package Grpc2Admin
import (
"context"
"dc_golang_server_1/data_db_cache/cache"
"dc_golang_server_1/data_db_cache/model"
myGRPC "dc_golang_server_1/my_grpc/grpc_area_map"
myGRPC "dc_golang_server_1/my_grpc/grpc_k122Server"
"errors"
)
//func (s *Server) CacheAddAreaService(ctx context.Context, req *myGRPC.CacheAreaServiceReq) (*myGRPC.Empty, error) {
//func (s *ToAdminServer) CacheAddAreaService(ctx context.Context, req *myGRPC.CacheAreaServiceReq) (*myGRPC.Empty, error) {
// if req == nil {
// return new(myGRPC.Empty), errors.New("入参不能为空")
// }
......@@ -39,7 +39,7 @@ import (
// return new(myGRPC.Empty), cache.UpdateAreaMapAddOrDelAreaServiceList(req.AreaID, req.AreaServiceID,false)
//}
func (s *Server) CacheAddAreaServicePhone(ctx context.Context, req *myGRPC.CacheAreaServicePhoneReq) (*myGRPC.Empty, error) {
func (s *ToAdminServer) CacheAddAreaServicePhone(ctx context.Context, req *myGRPC.CacheAreaServicePhoneReq) (*myGRPC.Empty, error) {
if req == nil {
return new(myGRPC.Empty), errors.New("入参不能为空")
}
......@@ -63,16 +63,15 @@ func (s *Server) CacheAddAreaServicePhone(ctx context.Context, req *myGRPC.Cache
req.ServicePhone,
req.ActivateCardFee,
req.ReplacementCardFee,
})
if err != nil {
return new(myGRPC.Empty), err
}
return new(myGRPC.Empty), cache.UpdateAreaMapAddOrDelAreaServiceList(req.AreaID, req.AreaServiceID,false)
return new(myGRPC.Empty), cache.UpdateAreaMapAddOrDelAreaServiceList(req.AreaID, req.AreaServiceID, false)
}
func (s *Server) CacheUpdateAreaServicePhone(ctx context.Context, req *myGRPC.CacheAreaServicePhoneReq) (*myGRPC.Empty, error) {
func (s *ToAdminServer) CacheUpdateAreaServicePhone(ctx context.Context, req *myGRPC.CacheAreaServicePhoneReq) (*myGRPC.Empty, error) {
if req == nil {
return new(myGRPC.Empty), errors.New("入参不能为空")
}
......@@ -84,14 +83,14 @@ func (s *Server) CacheUpdateAreaServicePhone(ctx context.Context, req *myGRPC.Ca
}
return new(myGRPC.Empty), cache.UpdateAreaServiceMapAndIfAreaIDChangeUpdateAreaMap(req.AreaServiceID, &model.CacheAreaServiceStruct{
AreaID: req.AreaID,
ServiceType: uint8(req.ServiceType),
OperatorID: req.OperatorID,
Name: req.Name,
Status: uint8(req.Status),
PayAdminID: req.AllinPayID,
ServicePhone: req.ServicePhone,
ActivateCardFee: req.ActivateCardFee,
AreaID: req.AreaID,
ServiceType: uint8(req.ServiceType),
OperatorID: req.OperatorID,
Name: req.Name,
Status: uint8(req.Status),
PayAdminID: req.AllinPayID,
ServicePhone: req.ServicePhone,
ActivateCardFee: req.ActivateCardFee,
ReplacementCardFee: req.ReplacementCardFee,
})
}
\ No newline at end of file
}
package Grpc2Admin
import (
"context"
"dc_golang_server_1/data_db_cache/cache"
"dc_golang_server_1/data_db_cache/model"
myGRPC "dc_golang_server_1/my_grpc/grpc_k122Server"
"errors"
)
func (s *ToAdminServer) CacheAddDevPhone20WhereAreaServiceIDNot0(ctx context.Context, reqs *myGRPC.CacheAddPhone20) (*myGRPC.Uint32S, error) {
if reqs.Rows == nil {
return nil, errors.New("入参不能为空")
}
res := new(myGRPC.Uint32S)
for _, req := range reqs.Rows {
if req.DevID == 0 {
continue
}
if req.AreaServiceID == 0 {
continue
}
if cache.CreatPhone20Map(req.DevID, &model.CachePhone20DeviceStruct{
AreaServiceID: req.AreaServiceID,
AllowCallTime: uint8(req.AllowCallTime),
PlaceUser: req.PlaceUser,
Status: req.Status,
}) {
res.Uint32S = append(res.Uint32S, req.DevID)
}
}
// fmt.Println(res.Uint32S)
return res, nil
}
//func (s *ToAdminServer) CheckDevPhone20Online(ctx context.Context,reqs *myGRPC.Uint32S) (*myGRPC.BoolS,error) {
// if reqs == nil {
// return nil,errors.New("入参不能为空")
// }
// res := new(myGRPC.BoolS)
// res.BoolS = make([]bool, len(reqs.Uint32S))
// for i,req := range reqs.Uint32S {
// if _, ok := dcphone20.TCP.ConnectMap.Load(req); ok {
// res.BoolS[i] = true
// }
// }
// return res,nil
//}
//
//func (s *ToAdminServer) GetDevPhone20OnlineList(ctx context.Context,reqs *myGRPC.Empty) (*myGRPC.Uint32S,error) {
// res := new(myGRPC.Uint32S)
// dcphone20.TCP.ConnectMap.Range(func(k, _ interface{}) bool {
// if d, ok := k.(uint32); ok { // 类型断言
// res.Uint32S = append(res.Uint32S, d) //strconv.FormatUint(uint64(d),16))
// } else {
// dcphone20.TCP.ConnectMap.Delete(k)
// // todo logger
// }
// return true
// })
// return res,nil
//}
func (s *ToAdminServer) CacheDeleteDevPhone20(ctx context.Context, reqs *myGRPC.Uint32S) (*myGRPC.Empty, error) {
for _, id := range reqs.Uint32S {
cache.DeletePhone20Map(id)
}
return new(myGRPC.Empty), nil
}
func (s *ToAdminServer) CacheAddDeviceUpdateFirmwareMapPhone20(ctx context.Context, reqs *myGRPC.CacheAddDeviceUpdateFirmwareMapPhone20Struct) (*myGRPC.Empty, error) {
if reqs == nil {
return nil, errors.New("入参不能为空")
}
cache.AddDeviceUpdateFirmwareMapPhone20(reqs.DevIDs, reqs.Firmware)
return new(myGRPC.Empty), nil
}
func (s *ToAdminServer) CacheDelDeviceUpdateFirmwareMapPhone20(ctx context.Context, reqs *myGRPC.Uint32S) (*myGRPC.Empty, error) {
cache.DelDeviceUpdateFirmwareMapPhone20(reqs.Uint32S)
return new(myGRPC.Empty), nil
}
package grpc_server
package Grpc2Admin
import (
"context"
"dc_golang_server_1/data_db_cache/cache"
"dc_golang_server_1/data_db_cache/model"
myGRPC "dc_golang_server_1/my_grpc/grpc_area_map"
myGRPC "dc_golang_server_1/my_grpc/grpc_k122Server"
"errors"
)
func (s *Server) CacheAddPhonePayList(ctx context.Context, req *myGRPC.CachePhonePayList) (*myGRPC.Empty, error) {
func (s *ToAdminServer) CacheAddPhonePayList(ctx context.Context, req *myGRPC.CachePhonePayList) (*myGRPC.Empty, error) {
if req == nil {
return new(myGRPC.Empty), errors.New("入参不能为空")
}
......@@ -17,15 +17,15 @@ func (s *Server) CacheAddPhonePayList(ctx context.Context, req *myGRPC.CachePhon
}
splitAmount := make([]model.PhonePaySplitMoneyStruct, len(req.SplitAmount))
for i,v := range req.SplitAmount {
for i, v := range req.SplitAmount {
splitAmount[i] = model.PhonePaySplitMoneyStruct{
AdminID: v.AdminID,
Amount: v.Amount,
Remark: v.Remark,
Remark: v.Remark,
}
}
return new(myGRPC.Empty),cache.AddPhonePayListMap(req.AreaServiceID, &model.CacheAreaServicePhonePayListStruct{
return new(myGRPC.Empty), cache.AddPhonePayListMap(req.AreaServiceID, &model.CacheAreaServicePhonePayListStruct{
CacheAreaServicePhonePayBase: model.CacheAreaServicePhonePayBase{
ID: req.ID,
Amount: req.Amount,
......@@ -34,11 +34,11 @@ func (s *Server) CacheAddPhonePayList(ctx context.Context, req *myGRPC.CachePhon
Describe: req.Describe,
},
SplitAmount: splitAmount,
Status: req.Status,
Status: req.Status,
})
}
func (s *Server) CacheUpdatePhonePayList(ctx context.Context, req *myGRPC.CachePhonePayList) (*myGRPC.Empty, error) {
func (s *ToAdminServer) CacheUpdatePhonePayList(ctx context.Context, req *myGRPC.CachePhonePayList) (*myGRPC.Empty, error) {
if req == nil {
return new(myGRPC.Empty), errors.New("入参不能为空")
}
......@@ -47,15 +47,15 @@ func (s *Server) CacheUpdatePhonePayList(ctx context.Context, req *myGRPC.CacheP
}
splitAmount := make([]model.PhonePaySplitMoneyStruct, len(req.SplitAmount))
for i,v := range req.SplitAmount {
for i, v := range req.SplitAmount {
splitAmount[i] = model.PhonePaySplitMoneyStruct{
AdminID: v.AdminID,
Amount: v.Amount,
Remark: v.Remark,
Remark: v.Remark,
}
}
return new(myGRPC.Empty),cache.UpdatePhonePayListMap(req.AreaServiceID, &model.CacheAreaServicePhonePayListStruct{
return new(myGRPC.Empty), cache.UpdatePhonePayListMap(req.AreaServiceID, &model.CacheAreaServicePhonePayListStruct{
CacheAreaServicePhonePayBase: model.CacheAreaServicePhonePayBase{
ID: req.ID,
Amount: req.Amount,
......@@ -64,11 +64,11 @@ func (s *Server) CacheUpdatePhonePayList(ctx context.Context, req *myGRPC.CacheP
Describe: req.Describe,
},
SplitAmount: splitAmount,
Status: req.Status,
Status: req.Status,
})
}
func (s *Server) CacheDelPhonePayList(ctx context.Context, req *myGRPC.CacheDelPhonePayListMsg) (*myGRPC.Empty, error) {
func (s *ToAdminServer) CacheDelPhonePayList(ctx context.Context, req *myGRPC.CacheDelPhonePayListMsg) (*myGRPC.Empty, error) {
if req == nil {
return new(myGRPC.Empty), errors.New("入参不能为空")
}
......@@ -77,5 +77,5 @@ func (s *Server) CacheDelPhonePayList(ctx context.Context, req *myGRPC.CacheDelP
}
cache.DelPhonePayListMap(req.AreaServiceID, req.ID)
return new(myGRPC.Empty),nil
}
\ No newline at end of file
return new(myGRPC.Empty), nil
}
package grpc_server
package Grpc2Admin
import (
"context"
"dc_golang_server_1/data_db_cache/cache"
"dc_golang_server_1/data_db_cache/model"
myGRPC "dc_golang_server_1/my_grpc/grpc_area_map"
myGRPC "dc_golang_server_1/my_grpc/grpc_k122Server"
"errors"
"time"
)
func (s *Server) CacheAddSimInfoNoBindStudentAndFamily(ctx context.Context, reqs *myGRPC.CacheAddNewSim) (*myGRPC.Strings, error) {
func (s *ToAdminServer) CacheAddSimInfoNoBindStudentAndFamily(ctx context.Context, reqs *myGRPC.CacheAddNewSim) (*myGRPC.Strings, error) {
if reqs.Rows == nil {
return nil, errors.New("入参不能为空")
}
......@@ -44,7 +44,7 @@ func (s *Server) CacheAddSimInfoNoBindStudentAndFamily(ctx context.Context, reqs
return res, nil
}
func (s *Server) CacheDeleteSimInfo(ctx context.Context, reqs *myGRPC.Strings) (*myGRPC.Empty, error) {
func (s *ToAdminServer) CacheDeleteSimInfo(ctx context.Context, reqs *myGRPC.Strings) (*myGRPC.Empty, error) {
cache.DeleteSimInfoMap(reqs.Strings)
return new(myGRPC.Empty), nil
}
package grpc_server
package Grpc2Admin
import (
"context"
"dc_golang_server_1/data_db_cache/cache"
myGRPC "dc_golang_server_1/my_grpc/grpc_area_map"
myGRPC "dc_golang_server_1/my_grpc/grpc_k122Server"
"errors"
)
func (s *Server) CacheUpdateUWeCustomerTestRole( ctx context.Context,req *myGRPC.CacheUWeCustomerTestRole) (*myGRPC.Empty,error) {
func (s *ToAdminServer) CacheUpdateUWeCustomerTestRole(ctx context.Context, req *myGRPC.CacheUWeCustomerTestRole) (*myGRPC.Empty, error) {
if req == nil {
return new(myGRPC.Empty),errors.New("入参不能为空")
return new(myGRPC.Empty), errors.New("入参不能为空")
}
if req.ID == 0 { //
return new(myGRPC.Empty),errors.New("用户ID错误")
return new(myGRPC.Empty), errors.New("用户ID错误")
}
return new(myGRPC.Empty),cache.UpdateUWeCustomerMapTestRole(req.ID,req.TestRole)
}
\ No newline at end of file
return new(myGRPC.Empty), cache.UpdateUWeCustomerMapTestRole(req.ID, req.TestRole)
}
package Grpc2Phone20TcpConn
import (
"context"
"dc_golang_server_1/my_grpc/grpc_k122Server"
"errors"
)
type ToTcpConnServer struct {
k122Server.UnimplementedGrpc2TcpConnServer
ReceiveResponse func(data []byte) (uint32, []byte, error)
}
func (s *ToTcpConnServer) ReceiveTcpCallback(ctx context.Context, req *k122Server.ReceiveTcpCallbackReq) (*k122Server.ReceiveTcpCallbackRes, error) {
if req == nil {
return nil, errors.New("入参不能为空")
}
res := new(k122Server.ReceiveTcpCallbackRes)
var err error
res.DeviceID, res.SendData, err = s.ReceiveResponse(req.Data)
return res, err
}
package grpc_server
import (
"context"
"dc_golang_server_1/data_db_cache/cache"
"dc_golang_server_1/data_db_cache/model"
"dc_golang_server_1/dev_product/dcphone20"
myGRPC "dc_golang_server_1/my_grpc/grpc_area_map"
"errors"
)
func (s *Server) CacheAddDevPhone20WhereAreaServiceIDNot0( ctx context.Context,reqs *myGRPC.CacheAddPhone20) (*myGRPC.Uint32S,error) {
if reqs.Rows == nil {
return nil,errors.New("入参不能为空")
}
res := new(myGRPC.Uint32S)
for _,req := range reqs.Rows {
if req.DevID == 0 {
continue
}
if req.AreaServiceID == 0 {
continue
}
if cache.CreatPhone20Map(req.DevID,&model.CachePhone20DeviceStruct{
AreaServiceID: req.AreaServiceID,
AllowCallTime: uint8(req.AllowCallTime),
PlaceUser: req.PlaceUser,
Status: req.Status,
}) {
res.Uint32S = append(res.Uint32S,req.DevID)
}
}
// fmt.Println(res.Uint32S)
return res,nil
}
func (s *Server) CheckDevPhone20Online(ctx context.Context,reqs *myGRPC.Uint32S) (*myGRPC.BoolS,error) {
if reqs == nil {
return nil,errors.New("入参不能为空")
}
res := new(myGRPC.BoolS)
res.BoolS = make([]bool, len(reqs.Uint32S))
for i,req := range reqs.Uint32S {
if _, ok := dcphone20.TCP.ConnectMap.Load(req); ok {
res.BoolS[i] = true
}
}
return res,nil
}
func (s *Server) GetDevPhone20OnlineList(ctx context.Context,reqs *myGRPC.Empty) (*myGRPC.Uint32S,error) {
res := new(myGRPC.Uint32S)
dcphone20.TCP.ConnectMap.Range(func(k, _ interface{}) bool {
if d, ok := k.(uint32); ok { // 类型断言
res.Uint32S = append(res.Uint32S, d) //strconv.FormatUint(uint64(d),16))
} else {
dcphone20.TCP.ConnectMap.Delete(k)
// todo logger
}
return true
})
return res,nil
}
func (s *Server) CacheDeleteDevPhone20(ctx context.Context,reqs *myGRPC.Uint32S) (*myGRPC.Empty,error) {
for _,id := range reqs.Uint32S {
cache.DeletePhone20Map(id)
}
return new(myGRPC.Empty),nil
}
func (s *Server) CacheAddDeviceUpdateFirmwareMapPhone20(ctx context.Context,reqs *myGRPC.CacheAddDeviceUpdateFirmwareMapPhone20Struct) (*myGRPC.Empty,error) {
if reqs == nil {
return nil,errors.New("入参不能为空")
}
cache.AddDeviceUpdateFirmwareMapPhone20(reqs.DevIDs,reqs.Firmware)
return new(myGRPC.Empty),nil
}
func (s *Server) CacheDelDeviceUpdateFirmwareMapPhone20(ctx context.Context,reqs *myGRPC.Uint32S) (*myGRPC.Empty,error) {
cache.DelDeviceUpdateFirmwareMapPhone20(reqs.Uint32S)
return new(myGRPC.Empty),nil
}
\ No newline at end of file
......@@ -5,9 +5,9 @@ import (
"dc_golang_server_1/data_db_cache/cache"
"dc_golang_server_1/data_db_cache/dbcurd"
"dc_golang_server_1/dev_product/dcphone20"
"dc_golang_server_1/grpc_server"
"dc_golang_server_1/grpc_server/Grpc2Admin"
"dc_golang_server_1/logger"
myGRPC "dc_golang_server_1/my_grpc/grpc_area_map"
myGRPC "dc_golang_server_1/my_grpc/grpc_k122Server"
"dc_golang_server_1/util/setting"
"fmt"
"google.golang.org/grpc"
......@@ -32,6 +32,7 @@ import (
// @Description /we/pay 接口调整
// @Description /we/payrecord 接口调整
// @Description /we/payrecord/{aid} [GET] 接口增加字段
// @Description 2022-02-26 /serverops/sysstate [GET] 取消PhoneTcpSocketNo字段,在adminServer去增加,因为连接硬件的服务从本服务剥离出去了
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name token
......@@ -66,7 +67,7 @@ func main() { //
panic(err)
}
s := grpc.NewServer()
myGRPC.RegisterMyGrpcServer(s, &grpc_server.Server{})
myGRPC.RegisterGrpc2AdminServer(s, &Grpc2Admin.ToAdminServer{})
err = s.Serve(l)
if err != nil {
panic(err)
......
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./grpc_area_map/areaMap.proto
\ No newline at end of file
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./grpc_k122Server/k122Server.proto ./grpc_deviceConnServer/deviceConnServer.proto
\ No newline at end of file
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.16.0
// source: grpc_area_map/areaMap.proto
package my_grpc
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type CacheAreaReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AreaID uint32 `protobuf:"varint,1,opt,name=AreaID,proto3" json:"AreaID,omitempty"`
Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
Longitude int32 `protobuf:"varint,3,opt,name=Longitude,proto3" json:"Longitude,omitempty"`
Latitude int32 `protobuf:"varint,4,opt,name=Latitude,proto3" json:"Latitude,omitempty"`
Status uint32 `protobuf:"varint,5,opt,name=Status,proto3" json:"Status,omitempty"`
CountyID uint32 `protobuf:"varint,6,opt,name=CountyID,proto3" json:"CountyID,omitempty"`
}
func (x *CacheAreaReq) Reset() {
*x = CacheAreaReq{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CacheAreaReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CacheAreaReq) ProtoMessage() {}
func (x *CacheAreaReq) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CacheAreaReq.ProtoReflect.Descriptor instead.
func (*CacheAreaReq) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{0}
}
func (x *CacheAreaReq) GetAreaID() uint32 {
if x != nil {
return x.AreaID
}
return 0
}
func (x *CacheAreaReq) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *CacheAreaReq) GetLongitude() int32 {
if x != nil {
return x.Longitude
}
return 0
}
func (x *CacheAreaReq) GetLatitude() int32 {
if x != nil {
return x.Latitude
}
return 0
}
func (x *CacheAreaReq) GetStatus() uint32 {
if x != nil {
return x.Status
}
return 0
}
func (x *CacheAreaReq) GetCountyID() uint32 {
if x != nil {
return x.CountyID
}
return 0
}
type CacheAreaServicePhoneReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AreaServiceID uint32 `protobuf:"varint,1,opt,name=AreaServiceID,proto3" json:"AreaServiceID,omitempty"`
AreaID uint32 `protobuf:"varint,2,opt,name=AreaID,proto3" json:"AreaID,omitempty"`
ServiceType uint32 `protobuf:"varint,3,opt,name=ServiceType,proto3" json:"ServiceType,omitempty"` //服务项目 1公话 2定位 3饮水 4POS .........
OperatorID uint32 `protobuf:"varint,4,opt,name=OperatorID,proto3" json:"OperatorID,omitempty"`
Status uint32 `protobuf:"varint,5,opt,name=Status,proto3" json:"Status,omitempty"` // 状态 0无内容1正式2测试3暂停4暂未开放
AllinPayID uint32 `protobuf:"varint,6,opt,name=AllinPayID,proto3" json:"AllinPayID,omitempty"` // 收款主体的adminID
Name string `protobuf:"bytes,7,opt,name=Name,proto3" json:"Name,omitempty"`
ServicePhone string `protobuf:"bytes,8,opt,name=ServicePhone,proto3" json:"ServicePhone,omitempty"` // 服务电话
ActivateCardFee int32 `protobuf:"varint,9,opt,name=ActivateCardFee,proto3" json:"ActivateCardFee,omitempty"` // 开卡费,修改时若不修改则传-1
ReplacementCardFee int32 `protobuf:"varint,10,opt,name=ReplacementCardFee,proto3" json:"ReplacementCardFee,omitempty"` // 补卡费,修改时若不修改则传-1
}
func (x *CacheAreaServicePhoneReq) Reset() {
*x = CacheAreaServicePhoneReq{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CacheAreaServicePhoneReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CacheAreaServicePhoneReq) ProtoMessage() {}
func (x *CacheAreaServicePhoneReq) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CacheAreaServicePhoneReq.ProtoReflect.Descriptor instead.
func (*CacheAreaServicePhoneReq) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{1}
}
func (x *CacheAreaServicePhoneReq) GetAreaServiceID() uint32 {
if x != nil {
return x.AreaServiceID
}
return 0
}
func (x *CacheAreaServicePhoneReq) GetAreaID() uint32 {
if x != nil {
return x.AreaID
}
return 0
}
func (x *CacheAreaServicePhoneReq) GetServiceType() uint32 {
if x != nil {
return x.ServiceType
}
return 0
}
func (x *CacheAreaServicePhoneReq) GetOperatorID() uint32 {
if x != nil {
return x.OperatorID
}
return 0
}
func (x *CacheAreaServicePhoneReq) GetStatus() uint32 {
if x != nil {
return x.Status
}
return 0
}
func (x *CacheAreaServicePhoneReq) GetAllinPayID() uint32 {
if x != nil {
return x.AllinPayID
}
return 0
}
func (x *CacheAreaServicePhoneReq) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *CacheAreaServicePhoneReq) GetServicePhone() string {
if x != nil {
return x.ServicePhone
}
return ""
}
func (x *CacheAreaServicePhoneReq) GetActivateCardFee() int32 {
if x != nil {
return x.ActivateCardFee
}
return 0
}
func (x *CacheAreaServicePhoneReq) GetReplacementCardFee() int32 {
if x != nil {
return x.ReplacementCardFee
}
return 0
}
type PhonePaySplitMoneyStruct struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AdminID uint32 `protobuf:"varint,1,opt,name=AdminID,proto3" json:"AdminID,omitempty"`
Amount int32 `protobuf:"varint,2,opt,name=Amount,proto3" json:"Amount,omitempty"`
Remark string `protobuf:"bytes,3,opt,name=Remark,proto3" json:"Remark,omitempty"`
}
func (x *PhonePaySplitMoneyStruct) Reset() {
*x = PhonePaySplitMoneyStruct{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PhonePaySplitMoneyStruct) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PhonePaySplitMoneyStruct) ProtoMessage() {}
func (x *PhonePaySplitMoneyStruct) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PhonePaySplitMoneyStruct.ProtoReflect.Descriptor instead.
func (*PhonePaySplitMoneyStruct) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{2}
}
func (x *PhonePaySplitMoneyStruct) GetAdminID() uint32 {
if x != nil {
return x.AdminID
}
return 0
}
func (x *PhonePaySplitMoneyStruct) GetAmount() int32 {
if x != nil {
return x.Amount
}
return 0
}
func (x *PhonePaySplitMoneyStruct) GetRemark() string {
if x != nil {
return x.Remark
}
return ""
}
type CachePhonePayList struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AreaServiceID uint32 `protobuf:"varint,1,opt,name=AreaServiceID,proto3" json:"AreaServiceID,omitempty"`
ID uint32 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"`
Amount int32 `protobuf:"varint,3,opt,name=Amount,proto3" json:"Amount,omitempty"`
MonthMin uint32 `protobuf:"varint,4,opt,name=MonthMin,proto3" json:"MonthMin,omitempty"`
Expiry uint32 `protobuf:"varint,5,opt,name=Expiry,proto3" json:"Expiry,omitempty"` // 有效期(单位:月)
Describe string `protobuf:"bytes,6,opt,name=Describe,proto3" json:"Describe,omitempty"`
Status bool `protobuf:"varint,7,opt,name=Status,proto3" json:"Status,omitempty"`
SplitAmount []*PhonePaySplitMoneyStruct `protobuf:"bytes,8,rep,name=SplitAmount,proto3" json:"SplitAmount,omitempty"`
}
func (x *CachePhonePayList) Reset() {
*x = CachePhonePayList{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CachePhonePayList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CachePhonePayList) ProtoMessage() {}
func (x *CachePhonePayList) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CachePhonePayList.ProtoReflect.Descriptor instead.
func (*CachePhonePayList) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{3}
}
func (x *CachePhonePayList) GetAreaServiceID() uint32 {
if x != nil {
return x.AreaServiceID
}
return 0
}
func (x *CachePhonePayList) GetID() uint32 {
if x != nil {
return x.ID
}
return 0
}
func (x *CachePhonePayList) GetAmount() int32 {
if x != nil {
return x.Amount
}
return 0
}
func (x *CachePhonePayList) GetMonthMin() uint32 {
if x != nil {
return x.MonthMin
}
return 0
}
func (x *CachePhonePayList) GetExpiry() uint32 {
if x != nil {
return x.Expiry
}
return 0
}
func (x *CachePhonePayList) GetDescribe() string {
if x != nil {
return x.Describe
}
return ""
}
func (x *CachePhonePayList) GetStatus() bool {
if x != nil {
return x.Status
}
return false
}
func (x *CachePhonePayList) GetSplitAmount() []*PhonePaySplitMoneyStruct {
if x != nil {
return x.SplitAmount
}
return nil
}
type CacheDelPhonePayListMsg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AreaServiceID uint32 `protobuf:"varint,1,opt,name=AreaServiceID,proto3" json:"AreaServiceID,omitempty"`
ID uint32 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"`
}
func (x *CacheDelPhonePayListMsg) Reset() {
*x = CacheDelPhonePayListMsg{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CacheDelPhonePayListMsg) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CacheDelPhonePayListMsg) ProtoMessage() {}
func (x *CacheDelPhonePayListMsg) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CacheDelPhonePayListMsg.ProtoReflect.Descriptor instead.
func (*CacheDelPhonePayListMsg) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{4}
}
func (x *CacheDelPhonePayListMsg) GetAreaServiceID() uint32 {
if x != nil {
return x.AreaServiceID
}
return 0
}
func (x *CacheDelPhonePayListMsg) GetID() uint32 {
if x != nil {
return x.ID
}
return 0
}
type CacheUWeCustomerTestRole struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ID uint32 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
TestRole bool `protobuf:"varint,2,opt,name=TestRole,proto3" json:"TestRole,omitempty"`
}
func (x *CacheUWeCustomerTestRole) Reset() {
*x = CacheUWeCustomerTestRole{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CacheUWeCustomerTestRole) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CacheUWeCustomerTestRole) ProtoMessage() {}
func (x *CacheUWeCustomerTestRole) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CacheUWeCustomerTestRole.ProtoReflect.Descriptor instead.
func (*CacheUWeCustomerTestRole) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{5}
}
func (x *CacheUWeCustomerTestRole) GetID() uint32 {
if x != nil {
return x.ID
}
return 0
}
func (x *CacheUWeCustomerTestRole) GetTestRole() bool {
if x != nil {
return x.TestRole
}
return false
}
type CacheAddNewSimStruct struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SimID string `protobuf:"bytes,1,opt,name=SimID,proto3" json:"SimID,omitempty"`
AreaServiceID uint32 `protobuf:"varint,2,opt,name=AreaServiceID,proto3" json:"AreaServiceID,omitempty"`
Status uint32 `protobuf:"varint,3,opt,name=Status,proto3" json:"Status,omitempty"`
MonthTalkMinutes uint32 `protobuf:"varint,4,opt,name=MonthTalkMinutes,proto3" json:"MonthTalkMinutes,omitempty"`
MonthPackageMinutes uint32 `protobuf:"varint,5,opt,name=MonthPackageMinutes,proto3" json:"MonthPackageMinutes,omitempty"`
ExpiryAt string `protobuf:"bytes,6,opt,name=ExpiryAt,proto3" json:"ExpiryAt,omitempty"`
FamilyDeleteCount uint32 `protobuf:"varint,7,opt,name=FamilyDeleteCount,proto3" json:"FamilyDeleteCount,omitempty"`
Type uint32 `protobuf:"varint,8,opt,name=Type,proto3" json:"Type,omitempty"` // 0 测试卡(不调任何接口) 1 中移物联网(增删亲情号调接口) 其他预留
}
func (x *CacheAddNewSimStruct) Reset() {
*x = CacheAddNewSimStruct{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CacheAddNewSimStruct) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CacheAddNewSimStruct) ProtoMessage() {}
func (x *CacheAddNewSimStruct) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CacheAddNewSimStruct.ProtoReflect.Descriptor instead.
func (*CacheAddNewSimStruct) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{6}
}
func (x *CacheAddNewSimStruct) GetSimID() string {
if x != nil {
return x.SimID
}
return ""
}
func (x *CacheAddNewSimStruct) GetAreaServiceID() uint32 {
if x != nil {
return x.AreaServiceID
}
return 0
}
func (x *CacheAddNewSimStruct) GetStatus() uint32 {
if x != nil {
return x.Status
}
return 0
}
func (x *CacheAddNewSimStruct) GetMonthTalkMinutes() uint32 {
if x != nil {
return x.MonthTalkMinutes
}
return 0
}
func (x *CacheAddNewSimStruct) GetMonthPackageMinutes() uint32 {
if x != nil {
return x.MonthPackageMinutes
}
return 0
}
func (x *CacheAddNewSimStruct) GetExpiryAt() string {
if x != nil {
return x.ExpiryAt
}
return ""
}
func (x *CacheAddNewSimStruct) GetFamilyDeleteCount() uint32 {
if x != nil {
return x.FamilyDeleteCount
}
return 0
}
func (x *CacheAddNewSimStruct) GetType() uint32 {
if x != nil {
return x.Type
}
return 0
}
type CacheAddNewSim struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Rows []*CacheAddNewSimStruct `protobuf:"bytes,1,rep,name=Rows,proto3" json:"Rows,omitempty"`
}
func (x *CacheAddNewSim) Reset() {
*x = CacheAddNewSim{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CacheAddNewSim) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CacheAddNewSim) ProtoMessage() {}
func (x *CacheAddNewSim) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CacheAddNewSim.ProtoReflect.Descriptor instead.
func (*CacheAddNewSim) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{7}
}
func (x *CacheAddNewSim) GetRows() []*CacheAddNewSimStruct {
if x != nil {
return x.Rows
}
return nil
}
type CacheAddPhone20Struct struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DevID uint32 `protobuf:"varint,1,opt,name=DevID,proto3" json:"DevID,omitempty"`
AreaServiceID uint32 `protobuf:"varint,2,opt,name=AreaServiceID,proto3" json:"AreaServiceID,omitempty"` // 不为0
AllowCallTime uint32 `protobuf:"varint,3,opt,name=AllowCallTime,proto3" json:"AllowCallTime,omitempty"`
PlaceUser string `protobuf:"bytes,4,opt,name=PlaceUser,proto3" json:"PlaceUser,omitempty"`
Status bool `protobuf:"varint,5,opt,name=Status,proto3" json:"Status,omitempty"`
}
func (x *CacheAddPhone20Struct) Reset() {
*x = CacheAddPhone20Struct{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CacheAddPhone20Struct) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CacheAddPhone20Struct) ProtoMessage() {}
func (x *CacheAddPhone20Struct) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CacheAddPhone20Struct.ProtoReflect.Descriptor instead.
func (*CacheAddPhone20Struct) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{8}
}
func (x *CacheAddPhone20Struct) GetDevID() uint32 {
if x != nil {
return x.DevID
}
return 0
}
func (x *CacheAddPhone20Struct) GetAreaServiceID() uint32 {
if x != nil {
return x.AreaServiceID
}
return 0
}
func (x *CacheAddPhone20Struct) GetAllowCallTime() uint32 {
if x != nil {
return x.AllowCallTime
}
return 0
}
func (x *CacheAddPhone20Struct) GetPlaceUser() string {
if x != nil {
return x.PlaceUser
}
return ""
}
func (x *CacheAddPhone20Struct) GetStatus() bool {
if x != nil {
return x.Status
}
return false
}
type CacheAddPhone20 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Rows []*CacheAddPhone20Struct `protobuf:"bytes,1,rep,name=Rows,proto3" json:"Rows,omitempty"`
}
func (x *CacheAddPhone20) Reset() {
*x = CacheAddPhone20{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CacheAddPhone20) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CacheAddPhone20) ProtoMessage() {}
func (x *CacheAddPhone20) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CacheAddPhone20.ProtoReflect.Descriptor instead.
func (*CacheAddPhone20) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{9}
}
func (x *CacheAddPhone20) GetRows() []*CacheAddPhone20Struct {
if x != nil {
return x.Rows
}
return nil
}
type CacheAddDeviceUpdateFirmwareMapPhone20Struct struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DevIDs []uint32 `protobuf:"varint,1,rep,packed,name=DevIDs,proto3" json:"DevIDs,omitempty"`
Firmware string `protobuf:"bytes,2,opt,name=Firmware,proto3" json:"Firmware,omitempty"`
}
func (x *CacheAddDeviceUpdateFirmwareMapPhone20Struct) Reset() {
*x = CacheAddDeviceUpdateFirmwareMapPhone20Struct{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CacheAddDeviceUpdateFirmwareMapPhone20Struct) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CacheAddDeviceUpdateFirmwareMapPhone20Struct) ProtoMessage() {}
func (x *CacheAddDeviceUpdateFirmwareMapPhone20Struct) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CacheAddDeviceUpdateFirmwareMapPhone20Struct.ProtoReflect.Descriptor instead.
func (*CacheAddDeviceUpdateFirmwareMapPhone20Struct) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{10}
}
func (x *CacheAddDeviceUpdateFirmwareMapPhone20Struct) GetDevIDs() []uint32 {
if x != nil {
return x.DevIDs
}
return nil
}
func (x *CacheAddDeviceUpdateFirmwareMapPhone20Struct) GetFirmware() string {
if x != nil {
return x.Firmware
}
return ""
}
type Uint32S struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uint32S []uint32 `protobuf:"varint,1,rep,packed,name=uint32s,proto3" json:"uint32s,omitempty"`
}
func (x *Uint32S) Reset() {
*x = Uint32S{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Uint32S) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Uint32S) ProtoMessage() {}
func (x *Uint32S) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Uint32S.ProtoReflect.Descriptor instead.
func (*Uint32S) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{11}
}
func (x *Uint32S) GetUint32S() []uint32 {
if x != nil {
return x.Uint32S
}
return nil
}
type BoolS struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
BoolS []bool `protobuf:"varint,1,rep,packed,name=boolS,proto3" json:"boolS,omitempty"`
}
func (x *BoolS) Reset() {
*x = BoolS{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BoolS) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BoolS) ProtoMessage() {}
func (x *BoolS) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BoolS.ProtoReflect.Descriptor instead.
func (*BoolS) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{12}
}
func (x *BoolS) GetBoolS() []bool {
if x != nil {
return x.BoolS
}
return nil
}
type Strings struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Strings []string `protobuf:"bytes,1,rep,name=strings,proto3" json:"strings,omitempty"`
}
func (x *Strings) Reset() {
*x = Strings{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Strings) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Strings) ProtoMessage() {}
func (x *Strings) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Strings.ProtoReflect.Descriptor instead.
func (*Strings) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{13}
}
func (x *Strings) GetStrings() []string {
if x != nil {
return x.Strings
}
return nil
}
type Empty struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Empty) Reset() {
*x = Empty{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Empty) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Empty) ProtoMessage() {}
func (x *Empty) ProtoReflect() protoreflect.Message {
mi := &file_grpc_area_map_areaMap_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
func (*Empty) Descriptor() ([]byte, []int) {
return file_grpc_area_map_areaMap_proto_rawDescGZIP(), []int{14}
}
var File_grpc_area_map_areaMap_proto protoreflect.FileDescriptor
var file_grpc_area_map_areaMap_proto_rawDesc = []byte{
0x0a, 0x1b, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x61, 0x72, 0x65, 0x61, 0x5f, 0x6d, 0x61, 0x70, 0x2f,
0x61, 0x72, 0x65, 0x61, 0x4d, 0x61, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6d,
0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x22, 0xa8, 0x01, 0x0a, 0x0c, 0x43, 0x61, 0x63, 0x68, 0x65,
0x41, 0x72, 0x65, 0x61, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x72, 0x65, 0x61, 0x49,
0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x41, 0x72, 0x65, 0x61, 0x49, 0x44, 0x12,
0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e,
0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x4c, 0x6f, 0x6e, 0x67, 0x69, 0x74, 0x75, 0x64, 0x65,
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4c, 0x6f, 0x6e, 0x67, 0x69, 0x74, 0x75, 0x64,
0x65, 0x12, 0x1a, 0x0a, 0x08, 0x4c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x05, 0x52, 0x08, 0x4c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x49,
0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x79, 0x49,
0x44, 0x22, 0xe4, 0x02, 0x0a, 0x18, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x72, 0x65, 0x61, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x12, 0x24,
0x0a, 0x0d, 0x41, 0x72, 0x65, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x41, 0x72, 0x65, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x72, 0x65, 0x61, 0x49, 0x44, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x41, 0x72, 0x65, 0x61, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0d, 0x52, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e,
0x0a, 0x0a, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01,
0x28, 0x0d, 0x52, 0x0a, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x44, 0x12, 0x16,
0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x41, 0x6c, 0x6c, 0x69, 0x6e, 0x50,
0x61, 0x79, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x41, 0x6c, 0x6c, 0x69,
0x6e, 0x50, 0x61, 0x79, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x28,
0x0a, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x64, 0x46, 0x65,
0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74,
0x65, 0x43, 0x61, 0x72, 0x64, 0x46, 0x65, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x52, 0x65, 0x70, 0x6c,
0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x72, 0x64, 0x46, 0x65, 0x65, 0x18, 0x0a,
0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e,
0x74, 0x43, 0x61, 0x72, 0x64, 0x46, 0x65, 0x65, 0x22, 0x64, 0x0a, 0x18, 0x50, 0x68, 0x6f, 0x6e,
0x65, 0x50, 0x61, 0x79, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x53, 0x74,
0x72, 0x75, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x44, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x44, 0x12, 0x16,
0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x8e,
0x02, 0x0a, 0x11, 0x43, 0x61, 0x63, 0x68, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x79,
0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x41, 0x72, 0x65, 0x61, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x41, 0x72, 0x65,
0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x4d, 0x69, 0x6e, 0x18, 0x04,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x4d, 0x69, 0x6e, 0x12, 0x16,
0x0a, 0x06, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06,
0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,
0x62, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,
0x62, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01,
0x28, 0x08, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x53, 0x70,
0x6c, 0x69, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x21, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x50,
0x61, 0x79, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x53, 0x74, 0x72, 0x75,
0x63, 0x74, 0x52, 0x0b, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22,
0x4f, 0x0a, 0x17, 0x43, 0x61, 0x63, 0x68, 0x65, 0x44, 0x65, 0x6c, 0x50, 0x68, 0x6f, 0x6e, 0x65,
0x50, 0x61, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x24, 0x0a, 0x0d, 0x41, 0x72,
0x65, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0d, 0x52, 0x0d, 0x41, 0x72, 0x65, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44,
0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x49, 0x44,
0x22, 0x46, 0x0a, 0x18, 0x43, 0x61, 0x63, 0x68, 0x65, 0x55, 0x57, 0x65, 0x43, 0x75, 0x73, 0x74,
0x6f, 0x6d, 0x65, 0x72, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02,
0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08,
0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08,
0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0xa6, 0x02, 0x0a, 0x14, 0x43, 0x61, 0x63,
0x68, 0x65, 0x41, 0x64, 0x64, 0x4e, 0x65, 0x77, 0x53, 0x69, 0x6d, 0x53, 0x74, 0x72, 0x75, 0x63,
0x74, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x69, 0x6d, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x53, 0x69, 0x6d, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x0d, 0x41, 0x72, 0x65, 0x61, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d,
0x41, 0x72, 0x65, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x16, 0x0a,
0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x54, 0x61,
0x6c, 0x6b, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x10, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x54, 0x61, 0x6c, 0x6b, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65,
0x73, 0x12, 0x30, 0x0a, 0x13, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67,
0x65, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13,
0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4d, 0x69, 0x6e, 0x75,
0x74, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x41, 0x74, 0x18,
0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x41, 0x74, 0x12,
0x2c, 0x0a, 0x11, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x46, 0x61, 0x6d, 0x69,
0x6c, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a,
0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x54, 0x79, 0x70,
0x65, 0x22, 0x43, 0x0a, 0x0e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64, 0x4e, 0x65, 0x77,
0x53, 0x69, 0x6d, 0x12, 0x31, 0x0a, 0x04, 0x52, 0x6f, 0x77, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x63, 0x68,
0x65, 0x41, 0x64, 0x64, 0x4e, 0x65, 0x77, 0x53, 0x69, 0x6d, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74,
0x52, 0x04, 0x52, 0x6f, 0x77, 0x73, 0x22, 0xaf, 0x01, 0x0a, 0x15, 0x43, 0x61, 0x63, 0x68, 0x65,
0x41, 0x64, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x30, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74,
0x12, 0x14, 0x0a, 0x05, 0x44, 0x65, 0x76, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x05, 0x44, 0x65, 0x76, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x0d, 0x41, 0x72, 0x65, 0x61, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x41,
0x72, 0x65, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x0d,
0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x43, 0x61, 0x6c, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x43, 0x61, 0x6c, 0x6c, 0x54, 0x69,
0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72,
0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08,
0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x45, 0x0a, 0x0f, 0x43, 0x61, 0x63, 0x68,
0x65, 0x41, 0x64, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x30, 0x12, 0x32, 0x0a, 0x04, 0x52,
0x6f, 0x77, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x79, 0x5f, 0x67,
0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64, 0x50, 0x68, 0x6f, 0x6e,
0x65, 0x32, 0x30, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x52, 0x6f, 0x77, 0x73, 0x22,
0x62, 0x0a, 0x2c, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63,
0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x72, 0x6d, 0x77, 0x61, 0x72, 0x65, 0x4d,
0x61, 0x70, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x30, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x12,
0x16, 0x0a, 0x06, 0x44, 0x65, 0x76, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52,
0x06, 0x44, 0x65, 0x76, 0x49, 0x44, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x46, 0x69, 0x72, 0x6d, 0x77,
0x61, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x46, 0x69, 0x72, 0x6d, 0x77,
0x61, 0x72, 0x65, 0x22, 0x23, 0x0a, 0x07, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x12, 0x18,
0x0a, 0x07, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52,
0x07, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x22, 0x1d, 0x0a, 0x05, 0x42, 0x6f, 0x6f, 0x6c,
0x53, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6f, 0x6f, 0x6c, 0x53, 0x18, 0x01, 0x20, 0x03, 0x28, 0x08,
0x52, 0x05, 0x62, 0x6f, 0x6f, 0x6c, 0x53, 0x22, 0x23, 0x0a, 0x07, 0x53, 0x74, 0x72, 0x69, 0x6e,
0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x07, 0x0a, 0x05,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x98, 0x09, 0x0a, 0x06, 0x4d, 0x79, 0x47, 0x72, 0x70, 0x63,
0x12, 0x35, 0x0a, 0x0c, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64, 0x41, 0x72, 0x65, 0x61,
0x12, 0x15, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65,
0x41, 0x72, 0x65, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70,
0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x38, 0x0a, 0x0f, 0x43, 0x61, 0x63, 0x68, 0x65,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x72, 0x65, 0x61, 0x12, 0x15, 0x2e, 0x6d, 0x79, 0x5f,
0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x72, 0x65, 0x61, 0x52, 0x65,
0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x12, 0x4d, 0x0a, 0x18, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64, 0x41, 0x72, 0x65,
0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x21, 0x2e,
0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x72, 0x65,
0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71,
0x1a, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x12, 0x50, 0x0a, 0x1b, 0x43, 0x61, 0x63, 0x68, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41,
0x72, 0x65, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x12,
0x21, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41,
0x72, 0x65, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x52,
0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x12, 0x42, 0x0a, 0x14, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64, 0x50, 0x68,
0x6f, 0x6e, 0x65, 0x50, 0x61, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x6d, 0x79, 0x5f,
0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x50,
0x61, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x45, 0x0a, 0x17, 0x43, 0x61, 0x63, 0x68, 0x65, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x79, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x1a, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x63, 0x68,
0x65, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x0e, 0x2e,
0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x48, 0x0a,
0x14, 0x43, 0x61, 0x63, 0x68, 0x65, 0x44, 0x65, 0x6c, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x50, 0x61,
0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e,
0x43, 0x61, 0x63, 0x68, 0x65, 0x44, 0x65, 0x6c, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x79,
0x4c, 0x69, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x1a, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70,
0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x53, 0x0a, 0x1e, 0x43, 0x61, 0x63, 0x68, 0x65,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x57, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65,
0x72, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x21, 0x2e, 0x6d, 0x79, 0x5f, 0x67,
0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x55, 0x57, 0x65, 0x43, 0x75, 0x73, 0x74,
0x6f, 0x6d, 0x65, 0x72, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x1a, 0x0e, 0x2e, 0x6d,
0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x52, 0x0a, 0x25,
0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64, 0x53, 0x69, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x4e,
0x6f, 0x42, 0x69, 0x6e, 0x64, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x46,
0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x17, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e,
0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64, 0x4e, 0x65, 0x77, 0x53, 0x69, 0x6d, 0x1a, 0x10,
0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73,
0x12, 0x36, 0x0a, 0x12, 0x43, 0x61, 0x63, 0x68, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53,
0x69, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63,
0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x1a, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72,
0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x56, 0x0a, 0x28, 0x43, 0x61, 0x63, 0x68,
0x65, 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x30, 0x57, 0x68,
0x65, 0x72, 0x65, 0x41, 0x72, 0x65, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44,
0x4e, 0x6f, 0x74, 0x30, 0x12, 0x18, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43,
0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x30, 0x1a, 0x10,
0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73,
0x12, 0x39, 0x0a, 0x15, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x65, 0x76, 0x50, 0x68, 0x6f, 0x6e,
0x65, 0x32, 0x30, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x10, 0x2e, 0x6d, 0x79, 0x5f, 0x67,
0x72, 0x70, 0x63, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x1a, 0x0e, 0x2e, 0x6d, 0x79,
0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x53, 0x12, 0x3b, 0x0a, 0x17, 0x47,
0x65, 0x74, 0x44, 0x65, 0x76, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x30, 0x4f, 0x6e, 0x6c, 0x69,
0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x10, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63,
0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x12, 0x39, 0x0a, 0x15, 0x43, 0x61, 0x63, 0x68,
0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32,
0x30, 0x12, 0x10, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x69, 0x6e, 0x74,
0x33, 0x32, 0x73, 0x1a, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x12, 0x6f, 0x0a, 0x26, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64, 0x44,
0x65, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x72, 0x6d, 0x77,
0x61, 0x72, 0x65, 0x4d, 0x61, 0x70, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x30, 0x12, 0x35, 0x2e,
0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x41, 0x64, 0x64,
0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x72, 0x6d,
0x77, 0x61, 0x72, 0x65, 0x4d, 0x61, 0x70, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x30, 0x53, 0x74,
0x72, 0x75, 0x63, 0x74, 0x1a, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45,
0x6d, 0x70, 0x74, 0x79, 0x12, 0x4a, 0x0a, 0x26, 0x43, 0x61, 0x63, 0x68, 0x65, 0x44, 0x65, 0x6c,
0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x72, 0x6d,
0x77, 0x61, 0x72, 0x65, 0x4d, 0x61, 0x70, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x32, 0x30, 0x12, 0x10,
0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73,
0x1a, 0x0e, 0x2e, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x6d, 0x79, 0x5f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_grpc_area_map_areaMap_proto_rawDescOnce sync.Once
file_grpc_area_map_areaMap_proto_rawDescData = file_grpc_area_map_areaMap_proto_rawDesc
)
func file_grpc_area_map_areaMap_proto_rawDescGZIP() []byte {
file_grpc_area_map_areaMap_proto_rawDescOnce.Do(func() {
file_grpc_area_map_areaMap_proto_rawDescData = protoimpl.X.CompressGZIP(file_grpc_area_map_areaMap_proto_rawDescData)
})
return file_grpc_area_map_areaMap_proto_rawDescData
}
var file_grpc_area_map_areaMap_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_grpc_area_map_areaMap_proto_goTypes = []interface{}{
(*CacheAreaReq)(nil), // 0: my_grpc.CacheAreaReq
(*CacheAreaServicePhoneReq)(nil), // 1: my_grpc.CacheAreaServicePhoneReq
(*PhonePaySplitMoneyStruct)(nil), // 2: my_grpc.PhonePaySplitMoneyStruct
(*CachePhonePayList)(nil), // 3: my_grpc.CachePhonePayList
(*CacheDelPhonePayListMsg)(nil), // 4: my_grpc.CacheDelPhonePayListMsg
(*CacheUWeCustomerTestRole)(nil), // 5: my_grpc.CacheUWeCustomerTestRole
(*CacheAddNewSimStruct)(nil), // 6: my_grpc.CacheAddNewSimStruct
(*CacheAddNewSim)(nil), // 7: my_grpc.CacheAddNewSim
(*CacheAddPhone20Struct)(nil), // 8: my_grpc.CacheAddPhone20Struct
(*CacheAddPhone20)(nil), // 9: my_grpc.CacheAddPhone20
(*CacheAddDeviceUpdateFirmwareMapPhone20Struct)(nil), // 10: my_grpc.CacheAddDeviceUpdateFirmwareMapPhone20Struct
(*Uint32S)(nil), // 11: my_grpc.Uint32s
(*BoolS)(nil), // 12: my_grpc.BoolS
(*Strings)(nil), // 13: my_grpc.Strings
(*Empty)(nil), // 14: my_grpc.Empty
}
var file_grpc_area_map_areaMap_proto_depIdxs = []int32{
2, // 0: my_grpc.CachePhonePayList.SplitAmount:type_name -> my_grpc.PhonePaySplitMoneyStruct
6, // 1: my_grpc.CacheAddNewSim.Rows:type_name -> my_grpc.CacheAddNewSimStruct
8, // 2: my_grpc.CacheAddPhone20.Rows:type_name -> my_grpc.CacheAddPhone20Struct
0, // 3: my_grpc.MyGrpc.CacheAddArea:input_type -> my_grpc.CacheAreaReq
0, // 4: my_grpc.MyGrpc.CacheUpdateArea:input_type -> my_grpc.CacheAreaReq
1, // 5: my_grpc.MyGrpc.CacheAddAreaServicePhone:input_type -> my_grpc.CacheAreaServicePhoneReq
1, // 6: my_grpc.MyGrpc.CacheUpdateAreaServicePhone:input_type -> my_grpc.CacheAreaServicePhoneReq
3, // 7: my_grpc.MyGrpc.CacheAddPhonePayList:input_type -> my_grpc.CachePhonePayList
3, // 8: my_grpc.MyGrpc.CacheUpdatePhonePayList:input_type -> my_grpc.CachePhonePayList
4, // 9: my_grpc.MyGrpc.CacheDelPhonePayList:input_type -> my_grpc.CacheDelPhonePayListMsg
5, // 10: my_grpc.MyGrpc.CacheUpdateUWeCustomerTestRole:input_type -> my_grpc.CacheUWeCustomerTestRole
7, // 11: my_grpc.MyGrpc.CacheAddSimInfoNoBindStudentAndFamily:input_type -> my_grpc.CacheAddNewSim
13, // 12: my_grpc.MyGrpc.CacheDeleteSimInfo:input_type -> my_grpc.Strings
9, // 13: my_grpc.MyGrpc.CacheAddDevPhone20WhereAreaServiceIDNot0:input_type -> my_grpc.CacheAddPhone20
11, // 14: my_grpc.MyGrpc.CheckDevPhone20Online:input_type -> my_grpc.Uint32s
14, // 15: my_grpc.MyGrpc.GetDevPhone20OnlineList:input_type -> my_grpc.Empty
11, // 16: my_grpc.MyGrpc.CacheDeleteDevPhone20:input_type -> my_grpc.Uint32s
10, // 17: my_grpc.MyGrpc.CacheAddDeviceUpdateFirmwareMapPhone20:input_type -> my_grpc.CacheAddDeviceUpdateFirmwareMapPhone20Struct
11, // 18: my_grpc.MyGrpc.CacheDelDeviceUpdateFirmwareMapPhone20:input_type -> my_grpc.Uint32s
14, // 19: my_grpc.MyGrpc.CacheAddArea:output_type -> my_grpc.Empty
14, // 20: my_grpc.MyGrpc.CacheUpdateArea:output_type -> my_grpc.Empty
14, // 21: my_grpc.MyGrpc.CacheAddAreaServicePhone:output_type -> my_grpc.Empty
14, // 22: my_grpc.MyGrpc.CacheUpdateAreaServicePhone:output_type -> my_grpc.Empty
14, // 23: my_grpc.MyGrpc.CacheAddPhonePayList:output_type -> my_grpc.Empty
14, // 24: my_grpc.MyGrpc.CacheUpdatePhonePayList:output_type -> my_grpc.Empty
14, // 25: my_grpc.MyGrpc.CacheDelPhonePayList:output_type -> my_grpc.Empty
14, // 26: my_grpc.MyGrpc.CacheUpdateUWeCustomerTestRole:output_type -> my_grpc.Empty
13, // 27: my_grpc.MyGrpc.CacheAddSimInfoNoBindStudentAndFamily:output_type -> my_grpc.Strings
14, // 28: my_grpc.MyGrpc.CacheDeleteSimInfo:output_type -> my_grpc.Empty
11, // 29: my_grpc.MyGrpc.CacheAddDevPhone20WhereAreaServiceIDNot0:output_type -> my_grpc.Uint32s
12, // 30: my_grpc.MyGrpc.CheckDevPhone20Online:output_type -> my_grpc.BoolS
11, // 31: my_grpc.MyGrpc.GetDevPhone20OnlineList:output_type -> my_grpc.Uint32s
14, // 32: my_grpc.MyGrpc.CacheDeleteDevPhone20:output_type -> my_grpc.Empty
14, // 33: my_grpc.MyGrpc.CacheAddDeviceUpdateFirmwareMapPhone20:output_type -> my_grpc.Empty
14, // 34: my_grpc.MyGrpc.CacheDelDeviceUpdateFirmwareMapPhone20:output_type -> my_grpc.Empty
19, // [19:35] is the sub-list for method output_type
3, // [3:19] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_grpc_area_map_areaMap_proto_init() }
func file_grpc_area_map_areaMap_proto_init() {
if File_grpc_area_map_areaMap_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_grpc_area_map_areaMap_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CacheAreaReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CacheAreaServicePhoneReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PhonePaySplitMoneyStruct); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CachePhonePayList); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CacheDelPhonePayListMsg); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CacheUWeCustomerTestRole); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CacheAddNewSimStruct); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CacheAddNewSim); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CacheAddPhone20Struct); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CacheAddPhone20); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CacheAddDeviceUpdateFirmwareMapPhone20Struct); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Uint32S); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BoolS); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Strings); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_area_map_areaMap_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Empty); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_grpc_area_map_areaMap_proto_rawDesc,
NumEnums: 0,
NumMessages: 15,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_grpc_area_map_areaMap_proto_goTypes,
DependencyIndexes: file_grpc_area_map_areaMap_proto_depIdxs,
MessageInfos: file_grpc_area_map_areaMap_proto_msgTypes,
}.Build()
File_grpc_area_map_areaMap_proto = out.File
file_grpc_area_map_areaMap_proto_rawDesc = nil
file_grpc_area_map_areaMap_proto_goTypes = nil
file_grpc_area_map_areaMap_proto_depIdxs = nil
}
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package my_grpc
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// MyGrpcClient is the client API for MyGrpc service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type MyGrpcClient interface {
// area
CacheAddArea(ctx context.Context, in *CacheAreaReq, opts ...grpc.CallOption) (*Empty, error)
CacheUpdateArea(ctx context.Context, in *CacheAreaReq, opts ...grpc.CallOption) (*Empty, error)
// area_service
// rpc CacheAddAreaService(CacheAreaServiceReq) returns(Empty);
CacheAddAreaServicePhone(ctx context.Context, in *CacheAreaServicePhoneReq, opts ...grpc.CallOption) (*Empty, error)
// rpc CacheUpdateAreaService(CacheAreaServiceReq) returns(Empty);
CacheUpdateAreaServicePhone(ctx context.Context, in *CacheAreaServicePhoneReq, opts ...grpc.CallOption) (*Empty, error)
// phone_pay_list
CacheAddPhonePayList(ctx context.Context, in *CachePhonePayList, opts ...grpc.CallOption) (*Empty, error)
CacheUpdatePhonePayList(ctx context.Context, in *CachePhonePayList, opts ...grpc.CallOption) (*Empty, error)
CacheDelPhonePayList(ctx context.Context, in *CacheDelPhonePayListMsg, opts ...grpc.CallOption) (*Empty, error)
// we_customer
CacheUpdateUWeCustomerTestRole(ctx context.Context, in *CacheUWeCustomerTestRole, opts ...grpc.CallOption) (*Empty, error)
// sim_card_info
CacheAddSimInfoNoBindStudentAndFamily(ctx context.Context, in *CacheAddNewSim, opts ...grpc.CallOption) (*Strings, error)
CacheDeleteSimInfo(ctx context.Context, in *Strings, opts ...grpc.CallOption) (*Empty, error)
// dev_phone20
CacheAddDevPhone20WhereAreaServiceIDNot0(ctx context.Context, in *CacheAddPhone20, opts ...grpc.CallOption) (*Uint32S, error)
CheckDevPhone20Online(ctx context.Context, in *Uint32S, opts ...grpc.CallOption) (*BoolS, error)
GetDevPhone20OnlineList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Uint32S, error)
CacheDeleteDevPhone20(ctx context.Context, in *Uint32S, opts ...grpc.CallOption) (*Empty, error)
// dev_firmware_phone20
CacheAddDeviceUpdateFirmwareMapPhone20(ctx context.Context, in *CacheAddDeviceUpdateFirmwareMapPhone20Struct, opts ...grpc.CallOption) (*Empty, error)
CacheDelDeviceUpdateFirmwareMapPhone20(ctx context.Context, in *Uint32S, opts ...grpc.CallOption) (*Empty, error)
}
type myGrpcClient struct {
cc grpc.ClientConnInterface
}
func NewMyGrpcClient(cc grpc.ClientConnInterface) MyGrpcClient {
return &myGrpcClient{cc}
}
func (c *myGrpcClient) CacheAddArea(ctx context.Context, in *CacheAreaReq, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheAddArea", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheUpdateArea(ctx context.Context, in *CacheAreaReq, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheUpdateArea", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheAddAreaServicePhone(ctx context.Context, in *CacheAreaServicePhoneReq, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheAddAreaServicePhone", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheUpdateAreaServicePhone(ctx context.Context, in *CacheAreaServicePhoneReq, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheUpdateAreaServicePhone", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheAddPhonePayList(ctx context.Context, in *CachePhonePayList, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheAddPhonePayList", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheUpdatePhonePayList(ctx context.Context, in *CachePhonePayList, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheUpdatePhonePayList", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheDelPhonePayList(ctx context.Context, in *CacheDelPhonePayListMsg, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheDelPhonePayList", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheUpdateUWeCustomerTestRole(ctx context.Context, in *CacheUWeCustomerTestRole, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheUpdateUWeCustomerTestRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheAddSimInfoNoBindStudentAndFamily(ctx context.Context, in *CacheAddNewSim, opts ...grpc.CallOption) (*Strings, error) {
out := new(Strings)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheAddSimInfoNoBindStudentAndFamily", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheDeleteSimInfo(ctx context.Context, in *Strings, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheDeleteSimInfo", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheAddDevPhone20WhereAreaServiceIDNot0(ctx context.Context, in *CacheAddPhone20, opts ...grpc.CallOption) (*Uint32S, error) {
out := new(Uint32S)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheAddDevPhone20WhereAreaServiceIDNot0", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CheckDevPhone20Online(ctx context.Context, in *Uint32S, opts ...grpc.CallOption) (*BoolS, error) {
out := new(BoolS)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CheckDevPhone20Online", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) GetDevPhone20OnlineList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Uint32S, error) {
out := new(Uint32S)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/GetDevPhone20OnlineList", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheDeleteDevPhone20(ctx context.Context, in *Uint32S, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheDeleteDevPhone20", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheAddDeviceUpdateFirmwareMapPhone20(ctx context.Context, in *CacheAddDeviceUpdateFirmwareMapPhone20Struct, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheAddDeviceUpdateFirmwareMapPhone20", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *myGrpcClient) CacheDelDeviceUpdateFirmwareMapPhone20(ctx context.Context, in *Uint32S, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/my_grpc.MyGrpc/CacheDelDeviceUpdateFirmwareMapPhone20", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// MyGrpcServer is the server API for MyGrpc service.
// All implementations must embed UnimplementedMyGrpcServer
// for forward compatibility
type MyGrpcServer interface {
// area
CacheAddArea(context.Context, *CacheAreaReq) (*Empty, error)
CacheUpdateArea(context.Context, *CacheAreaReq) (*Empty, error)
// area_service
// rpc CacheAddAreaService(CacheAreaServiceReq) returns(Empty);
CacheAddAreaServicePhone(context.Context, *CacheAreaServicePhoneReq) (*Empty, error)
// rpc CacheUpdateAreaService(CacheAreaServiceReq) returns(Empty);
CacheUpdateAreaServicePhone(context.Context, *CacheAreaServicePhoneReq) (*Empty, error)
// phone_pay_list
CacheAddPhonePayList(context.Context, *CachePhonePayList) (*Empty, error)
CacheUpdatePhonePayList(context.Context, *CachePhonePayList) (*Empty, error)
CacheDelPhonePayList(context.Context, *CacheDelPhonePayListMsg) (*Empty, error)
// we_customer
CacheUpdateUWeCustomerTestRole(context.Context, *CacheUWeCustomerTestRole) (*Empty, error)
// sim_card_info
CacheAddSimInfoNoBindStudentAndFamily(context.Context, *CacheAddNewSim) (*Strings, error)
CacheDeleteSimInfo(context.Context, *Strings) (*Empty, error)
// dev_phone20
CacheAddDevPhone20WhereAreaServiceIDNot0(context.Context, *CacheAddPhone20) (*Uint32S, error)
CheckDevPhone20Online(context.Context, *Uint32S) (*BoolS, error)
GetDevPhone20OnlineList(context.Context, *Empty) (*Uint32S, error)
CacheDeleteDevPhone20(context.Context, *Uint32S) (*Empty, error)
// dev_firmware_phone20
CacheAddDeviceUpdateFirmwareMapPhone20(context.Context, *CacheAddDeviceUpdateFirmwareMapPhone20Struct) (*Empty, error)
CacheDelDeviceUpdateFirmwareMapPhone20(context.Context, *Uint32S) (*Empty, error)
mustEmbedUnimplementedMyGrpcServer()
}
// UnimplementedMyGrpcServer must be embedded to have forward compatible implementations.
type UnimplementedMyGrpcServer struct {
}
func (UnimplementedMyGrpcServer) CacheAddArea(context.Context, *CacheAreaReq) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheAddArea not implemented")
}
func (UnimplementedMyGrpcServer) CacheUpdateArea(context.Context, *CacheAreaReq) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheUpdateArea not implemented")
}
func (UnimplementedMyGrpcServer) CacheAddAreaServicePhone(context.Context, *CacheAreaServicePhoneReq) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheAddAreaServicePhone not implemented")
}
func (UnimplementedMyGrpcServer) CacheUpdateAreaServicePhone(context.Context, *CacheAreaServicePhoneReq) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheUpdateAreaServicePhone not implemented")
}
func (UnimplementedMyGrpcServer) CacheAddPhonePayList(context.Context, *CachePhonePayList) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheAddPhonePayList not implemented")
}
func (UnimplementedMyGrpcServer) CacheUpdatePhonePayList(context.Context, *CachePhonePayList) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheUpdatePhonePayList not implemented")
}
func (UnimplementedMyGrpcServer) CacheDelPhonePayList(context.Context, *CacheDelPhonePayListMsg) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheDelPhonePayList not implemented")
}
func (UnimplementedMyGrpcServer) CacheUpdateUWeCustomerTestRole(context.Context, *CacheUWeCustomerTestRole) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheUpdateUWeCustomerTestRole not implemented")
}
func (UnimplementedMyGrpcServer) CacheAddSimInfoNoBindStudentAndFamily(context.Context, *CacheAddNewSim) (*Strings, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheAddSimInfoNoBindStudentAndFamily not implemented")
}
func (UnimplementedMyGrpcServer) CacheDeleteSimInfo(context.Context, *Strings) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheDeleteSimInfo not implemented")
}
func (UnimplementedMyGrpcServer) CacheAddDevPhone20WhereAreaServiceIDNot0(context.Context, *CacheAddPhone20) (*Uint32S, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheAddDevPhone20WhereAreaServiceIDNot0 not implemented")
}
func (UnimplementedMyGrpcServer) CheckDevPhone20Online(context.Context, *Uint32S) (*BoolS, error) {
return nil, status.Errorf(codes.Unimplemented, "method CheckDevPhone20Online not implemented")
}
func (UnimplementedMyGrpcServer) GetDevPhone20OnlineList(context.Context, *Empty) (*Uint32S, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDevPhone20OnlineList not implemented")
}
func (UnimplementedMyGrpcServer) CacheDeleteDevPhone20(context.Context, *Uint32S) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheDeleteDevPhone20 not implemented")
}
func (UnimplementedMyGrpcServer) CacheAddDeviceUpdateFirmwareMapPhone20(context.Context, *CacheAddDeviceUpdateFirmwareMapPhone20Struct) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheAddDeviceUpdateFirmwareMapPhone20 not implemented")
}
func (UnimplementedMyGrpcServer) CacheDelDeviceUpdateFirmwareMapPhone20(context.Context, *Uint32S) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CacheDelDeviceUpdateFirmwareMapPhone20 not implemented")
}
func (UnimplementedMyGrpcServer) mustEmbedUnimplementedMyGrpcServer() {}
// UnsafeMyGrpcServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MyGrpcServer will
// result in compilation errors.
type UnsafeMyGrpcServer interface {
mustEmbedUnimplementedMyGrpcServer()
}
func RegisterMyGrpcServer(s grpc.ServiceRegistrar, srv MyGrpcServer) {
s.RegisterService(&MyGrpc_ServiceDesc, srv)
}
func _MyGrpc_CacheAddArea_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CacheAreaReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheAddArea(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheAddArea",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheAddArea(ctx, req.(*CacheAreaReq))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheUpdateArea_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CacheAreaReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheUpdateArea(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheUpdateArea",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheUpdateArea(ctx, req.(*CacheAreaReq))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheAddAreaServicePhone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CacheAreaServicePhoneReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheAddAreaServicePhone(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheAddAreaServicePhone",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheAddAreaServicePhone(ctx, req.(*CacheAreaServicePhoneReq))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheUpdateAreaServicePhone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CacheAreaServicePhoneReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheUpdateAreaServicePhone(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheUpdateAreaServicePhone",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheUpdateAreaServicePhone(ctx, req.(*CacheAreaServicePhoneReq))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheAddPhonePayList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CachePhonePayList)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheAddPhonePayList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheAddPhonePayList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheAddPhonePayList(ctx, req.(*CachePhonePayList))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheUpdatePhonePayList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CachePhonePayList)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheUpdatePhonePayList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheUpdatePhonePayList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheUpdatePhonePayList(ctx, req.(*CachePhonePayList))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheDelPhonePayList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CacheDelPhonePayListMsg)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheDelPhonePayList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheDelPhonePayList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheDelPhonePayList(ctx, req.(*CacheDelPhonePayListMsg))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheUpdateUWeCustomerTestRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CacheUWeCustomerTestRole)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheUpdateUWeCustomerTestRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheUpdateUWeCustomerTestRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheUpdateUWeCustomerTestRole(ctx, req.(*CacheUWeCustomerTestRole))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheAddSimInfoNoBindStudentAndFamily_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CacheAddNewSim)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheAddSimInfoNoBindStudentAndFamily(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheAddSimInfoNoBindStudentAndFamily",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheAddSimInfoNoBindStudentAndFamily(ctx, req.(*CacheAddNewSim))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheDeleteSimInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Strings)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheDeleteSimInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheDeleteSimInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheDeleteSimInfo(ctx, req.(*Strings))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheAddDevPhone20WhereAreaServiceIDNot0_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CacheAddPhone20)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheAddDevPhone20WhereAreaServiceIDNot0(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheAddDevPhone20WhereAreaServiceIDNot0",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheAddDevPhone20WhereAreaServiceIDNot0(ctx, req.(*CacheAddPhone20))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CheckDevPhone20Online_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Uint32S)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CheckDevPhone20Online(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CheckDevPhone20Online",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CheckDevPhone20Online(ctx, req.(*Uint32S))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_GetDevPhone20OnlineList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).GetDevPhone20OnlineList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/GetDevPhone20OnlineList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).GetDevPhone20OnlineList(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheDeleteDevPhone20_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Uint32S)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheDeleteDevPhone20(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheDeleteDevPhone20",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheDeleteDevPhone20(ctx, req.(*Uint32S))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheAddDeviceUpdateFirmwareMapPhone20_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CacheAddDeviceUpdateFirmwareMapPhone20Struct)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheAddDeviceUpdateFirmwareMapPhone20(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheAddDeviceUpdateFirmwareMapPhone20",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheAddDeviceUpdateFirmwareMapPhone20(ctx, req.(*CacheAddDeviceUpdateFirmwareMapPhone20Struct))
}
return interceptor(ctx, in, info, handler)
}
func _MyGrpc_CacheDelDeviceUpdateFirmwareMapPhone20_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Uint32S)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MyGrpcServer).CacheDelDeviceUpdateFirmwareMapPhone20(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/my_grpc.MyGrpc/CacheDelDeviceUpdateFirmwareMapPhone20",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MyGrpcServer).CacheDelDeviceUpdateFirmwareMapPhone20(ctx, req.(*Uint32S))
}
return interceptor(ctx, in, info, handler)
}
// MyGrpc_ServiceDesc is the grpc.ServiceDesc for MyGrpc service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var MyGrpc_ServiceDesc = grpc.ServiceDesc{
ServiceName: "my_grpc.MyGrpc",
HandlerType: (*MyGrpcServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CacheAddArea",
Handler: _MyGrpc_CacheAddArea_Handler,
},
{
MethodName: "CacheUpdateArea",
Handler: _MyGrpc_CacheUpdateArea_Handler,
},
{
MethodName: "CacheAddAreaServicePhone",
Handler: _MyGrpc_CacheAddAreaServicePhone_Handler,
},
{
MethodName: "CacheUpdateAreaServicePhone",
Handler: _MyGrpc_CacheUpdateAreaServicePhone_Handler,
},
{
MethodName: "CacheAddPhonePayList",
Handler: _MyGrpc_CacheAddPhonePayList_Handler,
},
{
MethodName: "CacheUpdatePhonePayList",
Handler: _MyGrpc_CacheUpdatePhonePayList_Handler,
},
{
MethodName: "CacheDelPhonePayList",
Handler: _MyGrpc_CacheDelPhonePayList_Handler,
},
{
MethodName: "CacheUpdateUWeCustomerTestRole",
Handler: _MyGrpc_CacheUpdateUWeCustomerTestRole_Handler,
},
{
MethodName: "CacheAddSimInfoNoBindStudentAndFamily",
Handler: _MyGrpc_CacheAddSimInfoNoBindStudentAndFamily_Handler,
},
{
MethodName: "CacheDeleteSimInfo",
Handler: _MyGrpc_CacheDeleteSimInfo_Handler,
},
{
MethodName: "CacheAddDevPhone20WhereAreaServiceIDNot0",
Handler: _MyGrpc_CacheAddDevPhone20WhereAreaServiceIDNot0_Handler,
},
{
MethodName: "CheckDevPhone20Online",
Handler: _MyGrpc_CheckDevPhone20Online_Handler,
},
{
MethodName: "GetDevPhone20OnlineList",
Handler: _MyGrpc_GetDevPhone20OnlineList_Handler,
},
{
MethodName: "CacheDeleteDevPhone20",
Handler: _MyGrpc_CacheDeleteDevPhone20_Handler,
},
{
MethodName: "CacheAddDeviceUpdateFirmwareMapPhone20",
Handler: _MyGrpc_CacheAddDeviceUpdateFirmwareMapPhone20_Handler,
},
{
MethodName: "CacheDelDeviceUpdateFirmwareMapPhone20",
Handler: _MyGrpc_CacheDelDeviceUpdateFirmwareMapPhone20_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "grpc_area_map/areaMap.proto",
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.16.0
// source: grpc_deviceConnServer/deviceConnServer.proto
package deviceConnServer
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Empty struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Empty) Reset() {
*x = Empty{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Empty) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Empty) ProtoMessage() {}
func (x *Empty) ProtoReflect() protoreflect.Message {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
func (*Empty) Descriptor() ([]byte, []int) {
return file_grpc_deviceConnServer_deviceConnServer_proto_rawDescGZIP(), []int{0}
}
type Uint32S struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uint32S []uint32 `protobuf:"varint,1,rep,packed,name=uint32s,proto3" json:"uint32s,omitempty"`
}
func (x *Uint32S) Reset() {
*x = Uint32S{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Uint32S) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Uint32S) ProtoMessage() {}
func (x *Uint32S) ProtoReflect() protoreflect.Message {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Uint32S.ProtoReflect.Descriptor instead.
func (*Uint32S) Descriptor() ([]byte, []int) {
return file_grpc_deviceConnServer_deviceConnServer_proto_rawDescGZIP(), []int{1}
}
func (x *Uint32S) GetUint32S() []uint32 {
if x != nil {
return x.Uint32S
}
return nil
}
type BoolS struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
BoolS []bool `protobuf:"varint,1,rep,packed,name=boolS,proto3" json:"boolS,omitempty"`
}
func (x *BoolS) Reset() {
*x = BoolS{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BoolS) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BoolS) ProtoMessage() {}
func (x *BoolS) ProtoReflect() protoreflect.Message {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BoolS.ProtoReflect.Descriptor instead.
func (*BoolS) Descriptor() ([]byte, []int) {
return file_grpc_deviceConnServer_deviceConnServer_proto_rawDescGZIP(), []int{2}
}
func (x *BoolS) GetBoolS() []bool {
if x != nil {
return x.BoolS
}
return nil
}
type SendMsgToDeviceReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DevID uint32 `protobuf:"varint,1,opt,name=DevID,proto3" json:"DevID,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
}
func (x *SendMsgToDeviceReq) Reset() {
*x = SendMsgToDeviceReq{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SendMsgToDeviceReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SendMsgToDeviceReq) ProtoMessage() {}
func (x *SendMsgToDeviceReq) ProtoReflect() protoreflect.Message {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SendMsgToDeviceReq.ProtoReflect.Descriptor instead.
func (*SendMsgToDeviceReq) Descriptor() ([]byte, []int) {
return file_grpc_deviceConnServer_deviceConnServer_proto_rawDescGZIP(), []int{3}
}
func (x *SendMsgToDeviceReq) GetDevID() uint32 {
if x != nil {
return x.DevID
}
return 0
}
func (x *SendMsgToDeviceReq) GetData() []byte {
if x != nil {
return x.Data
}
return nil
}
type SendMsgToDeviceRes struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Res bool `protobuf:"varint,1,opt,name=Res,proto3" json:"Res,omitempty"`
}
func (x *SendMsgToDeviceRes) Reset() {
*x = SendMsgToDeviceRes{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SendMsgToDeviceRes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SendMsgToDeviceRes) ProtoMessage() {}
func (x *SendMsgToDeviceRes) ProtoReflect() protoreflect.Message {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SendMsgToDeviceRes.ProtoReflect.Descriptor instead.
func (*SendMsgToDeviceRes) Descriptor() ([]byte, []int) {
return file_grpc_deviceConnServer_deviceConnServer_proto_rawDescGZIP(), []int{4}
}
func (x *SendMsgToDeviceRes) GetRes() bool {
if x != nil {
return x.Res
}
return false
}
type Int32 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data int32 `protobuf:"varint,1,opt,name=Data,proto3" json:"Data,omitempty"`
}
func (x *Int32) Reset() {
*x = Int32{}
if protoimpl.UnsafeEnabled {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Int32) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Int32) ProtoMessage() {}
func (x *Int32) ProtoReflect() protoreflect.Message {
mi := &file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Int32.ProtoReflect.Descriptor instead.
func (*Int32) Descriptor() ([]byte, []int) {
return file_grpc_deviceConnServer_deviceConnServer_proto_rawDescGZIP(), []int{5}
}
func (x *Int32) GetData() int32 {
if x != nil {
return x.Data
}
return 0
}
var File_grpc_deviceConnServer_deviceConnServer_proto protoreflect.FileDescriptor
var file_grpc_deviceConnServer_deviceConnServer_proto_rawDesc = []byte{
0x0a, 0x2c, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e,
0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f,
0x6e, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10,
0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, 0x0a, 0x07, 0x55, 0x69, 0x6e,
0x74, 0x33, 0x32, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x07, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73, 0x22, 0x1d,
0x0a, 0x05, 0x42, 0x6f, 0x6f, 0x6c, 0x53, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6f, 0x6f, 0x6c, 0x53,
0x18, 0x01, 0x20, 0x03, 0x28, 0x08, 0x52, 0x05, 0x62, 0x6f, 0x6f, 0x6c, 0x53, 0x22, 0x3e, 0x0a,
0x12, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x54, 0x6f, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65,
0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x44, 0x65, 0x76, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0d, 0x52, 0x05, 0x44, 0x65, 0x76, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74,
0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x26, 0x0a,
0x12, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x54, 0x6f, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65,
0x52, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
0x52, 0x03, 0x52, 0x65, 0x73, 0x22, 0x1b, 0x0a, 0x05, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x12,
0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x44, 0x61,
0x74, 0x61, 0x32, 0xc5, 0x02, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e,
0x6e, 0x12, 0x5d, 0x0a, 0x0f, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x54, 0x6f, 0x44, 0x65,
0x76, 0x69, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e,
0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x54,
0x6f, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x64, 0x65, 0x76,
0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x65,
0x6e, 0x64, 0x4d, 0x73, 0x67, 0x54, 0x6f, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73,
0x12, 0x47, 0x0a, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4f,
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x19, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f,
0x6e, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x73,
0x1a, 0x17, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x53, 0x12, 0x49, 0x0a, 0x13, 0x47, 0x65, 0x74,
0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74,
0x12, 0x17, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x64, 0x65, 0x76, 0x69,
0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x55, 0x69, 0x6e,
0x74, 0x33, 0x32, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x63, 0x6b, 0x65,
0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63,
0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x1a, 0x17, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x42, 0x14, 0x5a, 0x12, 0x2e, 0x2f,
0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_grpc_deviceConnServer_deviceConnServer_proto_rawDescOnce sync.Once
file_grpc_deviceConnServer_deviceConnServer_proto_rawDescData = file_grpc_deviceConnServer_deviceConnServer_proto_rawDesc
)
func file_grpc_deviceConnServer_deviceConnServer_proto_rawDescGZIP() []byte {
file_grpc_deviceConnServer_deviceConnServer_proto_rawDescOnce.Do(func() {
file_grpc_deviceConnServer_deviceConnServer_proto_rawDescData = protoimpl.X.CompressGZIP(file_grpc_deviceConnServer_deviceConnServer_proto_rawDescData)
})
return file_grpc_deviceConnServer_deviceConnServer_proto_rawDescData
}
var file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_grpc_deviceConnServer_deviceConnServer_proto_goTypes = []interface{}{
(*Empty)(nil), // 0: deviceConnServer.Empty
(*Uint32S)(nil), // 1: deviceConnServer.Uint32s
(*BoolS)(nil), // 2: deviceConnServer.BoolS
(*SendMsgToDeviceReq)(nil), // 3: deviceConnServer.SendMsgToDeviceReq
(*SendMsgToDeviceRes)(nil), // 4: deviceConnServer.SendMsgToDeviceRes
(*Int32)(nil), // 5: deviceConnServer.Int32
}
var file_grpc_deviceConnServer_deviceConnServer_proto_depIdxs = []int32{
3, // 0: deviceConnServer.DeviceConn.SendMsgToDevice:input_type -> deviceConnServer.SendMsgToDeviceReq
1, // 1: deviceConnServer.DeviceConn.CheckDeviceOnline:input_type -> deviceConnServer.Uint32s
0, // 2: deviceConnServer.DeviceConn.GetDeviceOnlineList:input_type -> deviceConnServer.Empty
0, // 3: deviceConnServer.DeviceConn.GetSocketConnNum:input_type -> deviceConnServer.Empty
4, // 4: deviceConnServer.DeviceConn.SendMsgToDevice:output_type -> deviceConnServer.SendMsgToDeviceRes
2, // 5: deviceConnServer.DeviceConn.CheckDeviceOnline:output_type -> deviceConnServer.BoolS
1, // 6: deviceConnServer.DeviceConn.GetDeviceOnlineList:output_type -> deviceConnServer.Uint32s
5, // 7: deviceConnServer.DeviceConn.GetSocketConnNum:output_type -> deviceConnServer.Int32
4, // [4:8] is the sub-list for method output_type
0, // [0:4] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_grpc_deviceConnServer_deviceConnServer_proto_init() }
func file_grpc_deviceConnServer_deviceConnServer_proto_init() {
if File_grpc_deviceConnServer_deviceConnServer_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Empty); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Uint32S); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BoolS); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SendMsgToDeviceReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SendMsgToDeviceRes); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Int32); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_grpc_deviceConnServer_deviceConnServer_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_grpc_deviceConnServer_deviceConnServer_proto_goTypes,
DependencyIndexes: file_grpc_deviceConnServer_deviceConnServer_proto_depIdxs,
MessageInfos: file_grpc_deviceConnServer_deviceConnServer_proto_msgTypes,
}.Build()
File_grpc_deviceConnServer_deviceConnServer_proto = out.File
file_grpc_deviceConnServer_deviceConnServer_proto_rawDesc = nil
file_grpc_deviceConnServer_deviceConnServer_proto_goTypes = nil
file_grpc_deviceConnServer_deviceConnServer_proto_depIdxs = nil
}
syntax = "proto3";
option go_package = "./deviceConnServer";
package deviceConnServer;
// 硬件连接服务的GPRC
message Empty{}
message Uint32s {
repeated uint32 uint32s = 1;
}
message BoolS {
repeated bool boolS = 1;
}
message SendMsgToDeviceReq {
uint32 DevID = 1;
bytes Data = 2;
}
message SendMsgToDeviceRes {
bool Res = 1;
}
message Int32 {
int32 Data = 1;
}
service DeviceConn{
rpc SendMsgToDevice(SendMsgToDeviceReq) returns(SendMsgToDeviceRes); // 发送数据
rpc CheckDeviceOnline(Uint32s) returns(BoolS); // 拿devIDs来查设备是否在线,返回boolS
rpc GetDeviceOnlineList(Empty) returns(Uint32s); // 查询所有在线的ID,无序列表
rpc GetSocketConnNum(Empty) returns(Int32); // 查询硬件socket连接数
}
\ No newline at end of file
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package deviceConnServer
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// DeviceConnClient is the client API for DeviceConn service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type DeviceConnClient interface {
SendMsgToDevice(ctx context.Context, in *SendMsgToDeviceReq, opts ...grpc.CallOption) (*SendMsgToDeviceRes, error)
CheckDeviceOnline(ctx context.Context, in *Uint32S, opts ...grpc.CallOption) (*BoolS, error)
GetDeviceOnlineList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Uint32S, error)
GetSocketConnNum(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Int32, error)
}
type deviceConnClient struct {
cc grpc.ClientConnInterface
}
func NewDeviceConnClient(cc grpc.ClientConnInterface) DeviceConnClient {
return &deviceConnClient{cc}
}
func (c *deviceConnClient) SendMsgToDevice(ctx context.Context, in *SendMsgToDeviceReq, opts ...grpc.CallOption) (*SendMsgToDeviceRes, error) {
out := new(SendMsgToDeviceRes)
err := c.cc.Invoke(ctx, "/deviceConnServer.DeviceConn/SendMsgToDevice", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceConnClient) CheckDeviceOnline(ctx context.Context, in *Uint32S, opts ...grpc.CallOption) (*BoolS, error) {
out := new(BoolS)
err := c.cc.Invoke(ctx, "/deviceConnServer.DeviceConn/CheckDeviceOnline", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceConnClient) GetDeviceOnlineList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Uint32S, error) {
out := new(Uint32S)
err := c.cc.Invoke(ctx, "/deviceConnServer.DeviceConn/GetDeviceOnlineList", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceConnClient) GetSocketConnNum(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Int32, error) {
out := new(Int32)
err := c.cc.Invoke(ctx, "/deviceConnServer.DeviceConn/GetSocketConnNum", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// DeviceConnServer is the server API for DeviceConn service.
// All implementations must embed UnimplementedDeviceConnServer
// for forward compatibility
type DeviceConnServer interface {
SendMsgToDevice(context.Context, *SendMsgToDeviceReq) (*SendMsgToDeviceRes, error)
CheckDeviceOnline(context.Context, *Uint32S) (*BoolS, error)
GetDeviceOnlineList(context.Context, *Empty) (*Uint32S, error)
GetSocketConnNum(context.Context, *Empty) (*Int32, error)
mustEmbedUnimplementedDeviceConnServer()
}
// UnimplementedDeviceConnServer must be embedded to have forward compatible implementations.
type UnimplementedDeviceConnServer struct {
}
func (UnimplementedDeviceConnServer) SendMsgToDevice(context.Context, *SendMsgToDeviceReq) (*SendMsgToDeviceRes, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendMsgToDevice not implemented")
}
func (UnimplementedDeviceConnServer) CheckDeviceOnline(context.Context, *Uint32S) (*BoolS, error) {
return nil, status.Errorf(codes.Unimplemented, "method CheckDeviceOnline not implemented")
}
func (UnimplementedDeviceConnServer) GetDeviceOnlineList(context.Context, *Empty) (*Uint32S, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDeviceOnlineList not implemented")
}
func (UnimplementedDeviceConnServer) GetSocketConnNum(context.Context, *Empty) (*Int32, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSocketConnNum not implemented")
}
func (UnimplementedDeviceConnServer) mustEmbedUnimplementedDeviceConnServer() {}
// UnsafeDeviceConnServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DeviceConnServer will
// result in compilation errors.
type UnsafeDeviceConnServer interface {
mustEmbedUnimplementedDeviceConnServer()
}
func RegisterDeviceConnServer(s grpc.ServiceRegistrar, srv DeviceConnServer) {
s.RegisterService(&DeviceConn_ServiceDesc, srv)
}
func _DeviceConn_SendMsgToDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendMsgToDeviceReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceConnServer).SendMsgToDevice(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/deviceConnServer.DeviceConn/SendMsgToDevice",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceConnServer).SendMsgToDevice(ctx, req.(*SendMsgToDeviceReq))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceConn_CheckDeviceOnline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Uint32S)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceConnServer).CheckDeviceOnline(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/deviceConnServer.DeviceConn/CheckDeviceOnline",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceConnServer).CheckDeviceOnline(ctx, req.(*Uint32S))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceConn_GetDeviceOnlineList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceConnServer).GetDeviceOnlineList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/deviceConnServer.DeviceConn/GetDeviceOnlineList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceConnServer).GetDeviceOnlineList(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceConn_GetSocketConnNum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceConnServer).GetSocketConnNum(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/deviceConnServer.DeviceConn/GetSocketConnNum",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceConnServer).GetSocketConnNum(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
// DeviceConn_ServiceDesc is the grpc.ServiceDesc for DeviceConn service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DeviceConn_ServiceDesc = grpc.ServiceDesc{
ServiceName: "deviceConnServer.DeviceConn",
HandlerType: (*DeviceConnServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SendMsgToDevice",
Handler: _DeviceConn_SendMsgToDevice_Handler,
},
{
MethodName: "CheckDeviceOnline",
Handler: _DeviceConn_CheckDeviceOnline_Handler,
},
{
MethodName: "GetDeviceOnlineList",
Handler: _DeviceConn_GetDeviceOnlineList_Handler,
},
{
MethodName: "GetSocketConnNum",
Handler: _DeviceConn_GetSocketConnNum_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "grpc_deviceConnServer/deviceConnServer.proto",
}
syntax = "proto3";
// protoc --go_out=. -I=E:/Go/project/pkg/mod/github.com/protocolbuffers/protobuf@v3.19.1+incompatible/src -I=. google/protobuf/empty.proto --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./grpc_area_map/areaMap.proto
// import "google/protobuf/empty.proto";
// option go_package="./;my_grpc";
option go_package = "./my_grpc";
option go_package = "./k122Server";
package my_grpc;
......@@ -102,9 +98,9 @@ message Uint32s {
repeated uint32 uint32s = 1;
}
message BoolS {
repeated bool boolS = 1;
}
//message BoolS {
// repeated bool boolS = 1;
//}
message Strings {
repeated string strings = 1;
......@@ -112,7 +108,7 @@ message Strings {
message Empty{}
service MyGrpc{
service Grpc2Admin{
// area
rpc CacheAddArea(CacheAreaReq) returns(Empty);
rpc CacheUpdateArea(CacheAreaReq) returns(Empty);
......@@ -137,11 +133,24 @@ service MyGrpc{
// dev_phone20
rpc CacheAddDevPhone20WhereAreaServiceIDNot0(CacheAddPhone20) returns(Uint32s);
rpc CheckDevPhone20Online(Uint32s) returns(BoolS); // 拿devIDs来查设备是否在线,返回boolS
rpc GetDevPhone20OnlineList(Empty) returns(Uint32s); // 查询所有在线的ID,无序列表
// rpc CheckDevPhone20Online(Uint32s) returns(BoolS); // 拿devIDs来查设备是否在线,返回boolS
// rpc GetDevPhone20OnlineList(Empty) returns(Uint32s); // 查询所有在线的ID,无序列表
rpc CacheDeleteDevPhone20(Uint32s) returns(Empty); // 删除缓存的devPhone20设备,允许传入缓存里面没有的ID,反正只要有就会删
// dev_firmware_phone20
rpc CacheAddDeviceUpdateFirmwareMapPhone20(CacheAddDeviceUpdateFirmwareMapPhone20Struct) returns(Empty);
rpc CacheDelDeviceUpdateFirmwareMapPhone20(Uint32s) returns(Empty);
}
message ReceiveTcpCallbackReq {
bytes Data = 1;
}
message ReceiveTcpCallbackRes {
uint32 DeviceID = 1;
bytes SendData = 2;
}
service Grpc2TcpConn{
rpc ReceiveTcpCallback(ReceiveTcpCallbackReq) returns(ReceiveTcpCallbackRes);
}
\ No newline at end of file
......@@ -3,10 +3,15 @@ package setting
import (
"go.uber.org/zap/zapcore"
"gopkg.in/ini.v1"
"time"
)
var (
TokenKEY string
Grpc2AdminListenPort string
Grpc2TcpConnListenPort string
GrpcFromDeviceConnServerIpPort string
AllinPayAdminHead string
AllinPayCustomerHead string
......@@ -23,12 +28,6 @@ var (
// HttpSSL bool
// HttpServerSwagger bool
TcpLongPort string
TcpLongMaxConnections int32
TcpLongNewConnReadDeadline time.Duration
TcpLongNewConnRightfulTimeout int64
TcpLongOldConnReadDeadline time.Duration
SmsCaptchaUrl string
FirmwareServerUrl string
......@@ -59,6 +58,16 @@ func Init() {
panic("配置文件读取错误")
}
TokenKEY = file.Section("token").Key("KEY").String()
if len(TokenKEY) != 16 {
panic("配置文件读取错误:token:KEY 长度错误")
}
Grpc2AdminListenPort = file.Section("grpc_server").Key("Grpc2AdminListenPort").String()
Grpc2TcpConnListenPort = file.Section("grpc_server").Key("Grpc2TcpConnListenPort").String()
GrpcFromDeviceConnServerIpPort = file.Section("grpc_client").Key("GrpcFromDeviceConnServerIpPort").String()
AllinPayAdminHead = file.Section("allin_pay").Key("AdminHead").MustString("K12B")
AllinPayCustomerHead = file.Section("allin_pay").Key("CustomerHead").MustString("K12U")
......@@ -68,16 +77,7 @@ func Init() {
HttpServerMainHost = file.Section("http_server").Key("MainHost").MustString("k12m.dcrym.com")
// HttpServerMode = file.Section("http_server").Key("ServerMode").In("release", []string{"release", "debug"})
HttpServerPort = file.Section("http_server").Key("ServerPort").MustString(":50000")
// HttpSSL = file.Section("http_server").Key("HttpSSL").MustBool(false)
// HttpServerSwagger = file.Section("http_server").Key("Swagger").MustBool(false)
TcpLongPort = file.Section("tcp_long_server").Key("TcpPort").MustString("60000")
TcpLongMaxConnections = int32(file.Section("tcp_long_server").Key("MaxConnections").MustUint(20000))
TcpLongNewConnReadDeadline = time.Duration(file.Section("tcp_long_server").Key("NewConnReadDeadline").MustInt(60)) * time.Second
TcpLongNewConnRightfulTimeout = file.Section("tcp_long_server").Key("NewConnRightfulTimeout").MustInt64(120)
TcpLongOldConnReadDeadline = time.Duration(file.Section("tcp_long_server").Key("OldConnReadDeadline").MustInt(180)) * time.Second
SmsCaptchaUrl = file.Section("sms_captcha").Key("url").MustString("127.0.0.1:50003")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment