28 lines
501 B
Go
28 lines
501 B
Go
package controllers
|
|
|
|
import (
|
|
"WiiGoLibrary/apply/http/response/v1"
|
|
"encoding/json"
|
|
"io"
|
|
"os"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func VersionInfo(c *gin.Context) {
|
|
|
|
rtn := make(map[string]interface{})
|
|
file, err := os.Open("version.json")
|
|
if err != nil {
|
|
response.Fail(c, 103003, err.Error())
|
|
return
|
|
}
|
|
defer file.Close()
|
|
byteValue, _ := io.ReadAll(file)
|
|
if err := json.Unmarshal(byteValue, &rtn); err != nil {
|
|
response.Fail(c, 103003, err.Error())
|
|
return
|
|
}
|
|
response.Success(c, rtn)
|
|
}
|