|
|
@@ -6,9 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
-import com.goafanti.common.model.HtmlFragment;
|
|
|
import com.goafanti.fragment.service.FragmentService;
|
|
|
|
|
|
@RestController
|
|
|
@@ -19,17 +17,13 @@ public class FragmentController extends BaseApiController {
|
|
|
FragmentService fragmentService;
|
|
|
|
|
|
@RequestMapping(value = "/get/{id}", method = RequestMethod.GET)
|
|
|
- public Result get(@PathVariable String id) {
|
|
|
- return new Result(fragmentService.selectById(id));
|
|
|
+ public String get(@PathVariable String id) {
|
|
|
+ return fragmentService.selectById(id);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/json/{id}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
|
|
|
public String json(@PathVariable String id) {
|
|
|
- HtmlFragment hf = fragmentService.selectById(id);
|
|
|
- if (hf != null) {
|
|
|
- return hf.getContent();
|
|
|
- }
|
|
|
- return "{}";
|
|
|
+ return fragmentService.selectById(id);
|
|
|
}
|
|
|
|
|
|
}
|