Ich möchte einen anderen Zeichensatz für die Antwort eines Controllers angeben. Die Antworten aller anderen Controller s

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Ich möchte einen anderen Zeichensatz für die Antwort eines Controllers angeben. Die Antworten aller anderen Controller s

by Guest » 07 Jan 2025, 13:17

Code: Select all

@RestController
@RequestMapping(value = "/xyz")
public class SysControlMachineController extends BaseController {

@Autowired
private ISysControlMachineService controlMachineService;

/**
* get server time
*/
@PostMapping(value="/ServerTime", produces="application/json;charset=utf-8")
public ControlResult getServerTime(@RequestBody SysServerTime serverTime,
@RequestHeader("Device-ID") String deviceId) {
return controlMachineService.getServerTime(serverTime, wtrDeviceId);
}

/**
* comprehensive process
*/
@PostMapping(value="/ConsumTransactions", produces="application/json;charset=GB2312")
public ControlResult consumTransactions(@RequestBody SysConSum conSum,
@RequestHeader(name = "Device-ID") String deviceId)

{
return controlMachineService.consumTransactions(conSum, deviceId);
}
Ich fordere die erste getServiceTime-Rest-API an, es gibt eine Erfolgsantwort; aber wenn ich die zweite consumTransactions-API anfordere, wird der Fehler zurückgegeben:

„Kein Konverter für [Klasse com.....domain.ControlResult] mit voreingestelltem Inhalt- Geben Sie „null“ ein.

Top