Commit 5905b42a authored by Quxl's avatar Quxl

x

parent 6e03d87c
......@@ -11,4 +11,6 @@ public interface FilmGroupService {
void updateFilmGroupId(Integer film_id, Integer group_id);
void removeFilmGroupById(Integer id);
}
......@@ -5,6 +5,7 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.film.api.service.FilmGroupService;
......@@ -29,5 +30,12 @@ public class FilmGroupServiceImpl implements FilmGroupService {
public void updateFilmGroupId(Integer film_id, Integer group_id) {
jdbcTemplate.executeUpdate("update fc_member_film set group_id = ? where id = ?", group_id, film_id);
}
@Override
@Transactional
public void removeFilmGroupById(Integer id) {
jdbcTemplate.executeUpdate("delete from fc_film_group where id = ?", id);
jdbcTemplate.executeUpdate("update fc_member_film set group_id = ? where group_id = ?", id, id);
}
}
......@@ -41,6 +41,14 @@ public class FilmGroupController {
return Rjx.jsonOk().setData(g);
}
@ResponseBody
@PostMapping("delete")
@ApiOperation("保存或更新分类")
public Object delete(Integer id) {
filmGroupService.removeFilmGroupById(id);
return Rjx.jsonOk();
}
@ResponseBody
@PostMapping("getFilmGroupList")
@ApiOperation("保存分类")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment