| | |
| | | private JdbcTemplate jdbcTemplate; |
| | | |
| | | @GetMapping("/media") |
| | | public Object getMedia(@RequestParam Integer targetType, @RequestParam String targetId) { |
| | | public Object getMedia(@RequestParam Integer targetType, @RequestParam Long targetId) { |
| | | try { |
| | | String sql = "SELECT id, name, path, file_ext, media_type, target_type, target_id " + |
| | | "FROM t_media WHERE target_type = ? AND target_id = ?"; |
| | | |
| | | List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql, targetType, Long.parseLong(targetId)); |
| | | List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql, targetType, targetId); |
| | | return rows; |
| | | } catch (Exception e) { |
| | | return "错误: " + e.getMessage(); |