|
@@ -40,7 +40,7 @@ func (c *tenant) GetDetail(ctx *gin.Context) {
|
|
|
func (c *tenant) List(ctx *gin.Context) {
|
|
|
current, _ := strconv.Atoi(ctx.Query("current"))
|
|
|
size, _ := strconv.Atoi(ctx.Query("size"))
|
|
|
- tenantId := ctx.Query("tenantId")
|
|
|
+ tId := ctx.Query("tenantId")
|
|
|
tenantName := ctx.Query("tenantName")
|
|
|
linkman := ctx.Query("linkman")
|
|
|
if current == 0 {
|
|
@@ -50,12 +50,12 @@ func (c *tenant) List(ctx *gin.Context) {
|
|
|
size = 10
|
|
|
}
|
|
|
|
|
|
- tId, err := strconv.Atoi(tenantId)
|
|
|
- if err != nil {
|
|
|
- ctx.JSON(http.StatusOK, common.ParamsInvalidResponse(err.Error(), nil))
|
|
|
- return
|
|
|
+ tenantId := -1
|
|
|
+ if tId != "" {
|
|
|
+ tenantId, _ = strconv.Atoi(tId)
|
|
|
}
|
|
|
- tenants, err := service.TenantService.List(tId, tenantName, linkman, current, size)
|
|
|
+
|
|
|
+ tenants, err := service.TenantService.List(tenantId, tenantName, linkman, current, size)
|
|
|
if err != nil {
|
|
|
ctx.JSON(http.StatusOK, err)
|
|
|
return
|