body와 query 분리, 모듈 업데이트
This commit is contained in:
@ -223,7 +223,7 @@ func (gc *groupChat) ClientMessageReceived(sender *wshandler.Sender, mt wshandle
|
||||
}
|
||||
|
||||
func (gc *groupChat) FetchChattingChannels(w http.ResponseWriter, r *http.Request) {
|
||||
prefix, _ := gocommon.ReadStringFormValue(r.Form, "prefix")
|
||||
prefix, _ := gocommon.ReadStringFormValue(r.URL.Query(), "prefix")
|
||||
if len(prefix) == 0 {
|
||||
logger.Println("FetchChattingChannel failed. prefix is missing")
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
@ -269,8 +269,8 @@ func (gc *groupChat) FetchChattingChannels(w http.ResponseWriter, r *http.Reques
|
||||
}
|
||||
|
||||
func (gc *groupChat) QueryPlayerChattingChannel(w http.ResponseWriter, r *http.Request) {
|
||||
accid, _ := gocommon.ReadStringFormValue(r.Form, "accid")
|
||||
typename, _ := gocommon.ReadStringFormValue(r.Form, "typename")
|
||||
accid, _ := gocommon.ReadStringFormValue(r.URL.Query(), "accid")
|
||||
typename, _ := gocommon.ReadStringFormValue(r.URL.Query(), "typename")
|
||||
|
||||
var fields []string
|
||||
if len(typename) == 0 {
|
||||
@ -298,9 +298,9 @@ func (gc *groupChat) QueryPlayerChattingChannel(w http.ResponseWriter, r *http.R
|
||||
}
|
||||
|
||||
func (gc *groupChat) SendMessageOnChannel(w http.ResponseWriter, r *http.Request) {
|
||||
channel, _ := gocommon.ReadStringFormValue(r.Form, "channel")
|
||||
target, _ := gocommon.ReadStringFormValue(r.Form, "target")
|
||||
tag, _ := gocommon.ReadStringFormValue(r.Form, "tag")
|
||||
channel, _ := gocommon.ReadStringFormValue(r.URL.Query(), "channel")
|
||||
target, _ := gocommon.ReadStringFormValue(r.URL.Query(), "target")
|
||||
tag, _ := gocommon.ReadStringFormValue(r.URL.Query(), "tag")
|
||||
if len(channel) == 0 || len(target) == 0 || len(tag) == 0 {
|
||||
logger.Println("SendMessageOnChannel failed. channel or target or tag is empty")
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
@ -331,9 +331,9 @@ func (gc *groupChat) SendMessageOnChannel(w http.ResponseWriter, r *http.Request
|
||||
}
|
||||
|
||||
func (gc *groupChat) BroadcastMessageOnChannel(w http.ResponseWriter, r *http.Request) {
|
||||
nickname, _ := gocommon.ReadStringFormValue(r.Form, "nickname")
|
||||
channel, _ := gocommon.ReadStringFormValue(r.Form, "channel")
|
||||
tag, _ := gocommon.ReadStringFormValue(r.Form, "tag")
|
||||
nickname, _ := gocommon.ReadStringFormValue(r.URL.Query(), "nickname")
|
||||
channel, _ := gocommon.ReadStringFormValue(r.URL.Query(), "channel")
|
||||
tag, _ := gocommon.ReadStringFormValue(r.URL.Query(), "tag")
|
||||
text, _ := io.ReadAll(r.Body)
|
||||
|
||||
if len(tag) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user