[api] convert sub to Json
This commit is contained in:
@@ -48,6 +48,8 @@ func (a *APIHandler) postHandler(c *gin.Context) {
|
||||
a.ApiService.RestartSb(c)
|
||||
case "linkConvert":
|
||||
a.ApiService.LinkConvert(c)
|
||||
case "subConvert":
|
||||
a.ApiService.SubConvert(c)
|
||||
case "importdb":
|
||||
a.ApiService.ImportDb(c)
|
||||
case "addToken":
|
||||
|
||||
@@ -330,6 +330,12 @@ func (a *ApiService) LinkConvert(c *gin.Context) {
|
||||
jsonObj(c, result, err)
|
||||
}
|
||||
|
||||
func (a *ApiService) SubConvert(c *gin.Context) {
|
||||
link := c.Request.FormValue("link")
|
||||
result, err := util.GetExternalSub(link)
|
||||
jsonObj(c, result, err)
|
||||
}
|
||||
|
||||
func (a *ApiService) ImportDb(c *gin.Context) {
|
||||
file, _, err := c.Request.FormFile("db")
|
||||
if err != nil {
|
||||
|
||||
@@ -49,6 +49,8 @@ func (a *APIv2Handler) postHandler(c *gin.Context) {
|
||||
a.ApiService.RestartSb(c)
|
||||
case "linkConvert":
|
||||
a.ApiService.LinkConvert(c)
|
||||
case "subConvert":
|
||||
a.ApiService.SubConvert(c)
|
||||
case "importdb":
|
||||
a.ApiService.ImportDb(c)
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user