feat: 添加获取登录账户信息的功能,并更新相关数据结构和常量
This commit is contained in:
@@ -104,15 +104,3 @@ func (am *actionManager) DrawbackMsg(msgId int32) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (am *actionManager) GetGroupMemberList(groupId int64) ([]int64, error) {
|
||||
askGroupMemberListPkg := model.GenGetGroupMemberListPkg(groupId)
|
||||
askGroupMemberListPkgJson, err := json.Marshal(askGroupMemberListPkg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err = am.botConn.WriteMessage(websocket.TextMessage, askGroupMemberListPkgJson); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, nil //todo
|
||||
}
|
||||
|
||||
@@ -56,3 +56,26 @@ func GetGroupList() ([]model.Group, error) {
|
||||
|
||||
return groupListResponse.Data, nil
|
||||
}
|
||||
|
||||
func (am *actionManager) GetLoginAccountInfo() (*model.LoginAccountInfoResponse, error) {
|
||||
fullURL := fmt.Sprintf("http://%s%s", config.ConfigManager.GetConfig().Management.NapcatHttpSrv, constants.GET_LOGIN_INFO)
|
||||
|
||||
response, err := http.Post(fullURL, "application/json", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer response.Body.Close()
|
||||
|
||||
body, err := io.ReadAll(response.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var loginAccountInfoResponse model.LoginAccountInfoResponse
|
||||
err = json.Unmarshal(body, &loginAccountInfoResponse)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &loginAccountInfoResponse, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user