22 lines
425 B
Go
22 lines
425 B
Go
package api
|
|
|
|
import (
|
|
"ArmedPolice/app/controller/config"
|
|
"ArmedPolice/app/service"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type Config struct{}
|
|
|
|
func (*Config) Area(c *gin.Context) {
|
|
form := &struct {
|
|
Key string `json:"key" form:"key"`
|
|
}{}
|
|
if err := bind(form)(c); err != nil {
|
|
APIFailure(err.(error))(c)
|
|
return
|
|
}
|
|
data := config.NewInstance()(getSession()(c).(*service.Session)).Area(form.Key)
|
|
APIResponse(nil, data)
|
|
}
|