123456789101112131415161718192021222324252627282930313233 |
- package controllers
- import (
- //"fmt"
- "github.com/gin-gonic/gin"
- "lzyd-message-api/common"
- "lzyd-message-api/services"
- )
- // @tags 房间操作
- // @Description 获取房间详情
- // @Summary 获取房间详情
- // @Accept json
- // @Produce json
- // @Param room_id query string true "房间id"
- // @Success 200 {string} json "{"code":200, "message":"success"}"
- // @Router /api/chatroom/detail [get]
- func ChatroomDetail(c *gin.Context) {
- roomId := c.Query("room_id")
- if roomId == "" || roomId == "0"{
- common.ReturnFailureMsg(c, common.InternalError, "room_id 不能为空")
- return
- }
- err,data := services.ChatroomDetail(common.DB, roomId)
- if err != nil {
- common.ReturnFailureMsg(c, common.InternalError, err.Error())
- return
- }
- common.ReturnSuccess(c, data)
- }
|